Commit 0bbb7e8c authored by Vitaly Lipatov's avatar Vitaly Lipatov

use epm tool eget instead of EGET variable

parent 2998b616
......@@ -122,9 +122,8 @@ __epm_play_run()
local script="$psdir/$1.sh"
shift
# allow use EGET in the scripts
__set_EGET
# also we will have DISTRVENDOR there
# TODO: use epm print info instead of one?
# we will have DISTRVENDOR there
export PATH=$PROGDIR:$PATH
set_sudo
......
......@@ -462,21 +462,6 @@ assure_exists()
( direct='' epm_assure "$1" $package $3 ) || fatal "Can't assure in '$1' command from $package$textpackage package"
}
__set_EGET()
{
# use internal eget only if exists
if [ -s $SHAREDIR/tools_eget ] ; then
export EGET="$SHAREDIR/tools_eget"
return
fi
fatal "Internal error: missed tools_eget"
# FIXME: we need disable output here, eget can be used for get output
assure_exists eget eget 3.3 >/dev/null
# use external command, not the function
export EGET="$(which eget)" || fatal "Missed command eget from installed package eget"
}
# will replaced within disabled_eget in packaged version
eget()
{
......
Allowed variables:
* $EGET (wget like utility)
* $DISTRVENDOR (distro_info utility)
* $SUDO
Allowed command:
Allowed commands:
* epm (run the same epm called from)
* epm tool eget (wget like utility)
* epm tool estrlist (string operations)
TODO:
* inject some functions
See any file for
. $(dirname $0)/common.sh
using
TODO:
* save packages for remove
......@@ -35,7 +35,7 @@ PKGMASK="$(epm print constructname $PKGNAME "6.1*" $arch '' '_')"
# lib.req: WARNING: /usr/bin/anydesk: library libpangox-1.0.so.0 not found
#[ "$($DISTRVENDOR -s)" = "alt" ] && PKGMASK="os-specific/rhel8/$(epm print constructname $PKGNAME "*" $arch)"
PKG="$($EGET --list --latest https://download.anydesk.com/linux $PKGMASK)" || fatal "Can't get package URL"
PKG="$(epm tool eget --list --latest https://download.anydesk.com/linux $PKGMASK)" || fatal "Can't get package URL"
epm $repack install "$PKG" || exit
......
......@@ -13,6 +13,6 @@ DESCRIPTION="The hackable text editor from the official site"
arch=amd64
pkgtype=deb
PKG=$($EGET --list --latest https://github.com/atom/atom/releases/ "atom-$arch.$pkgtype") || fatal "Can't get package URL"
PKG=$(epm tool eget --list --latest https://github.com/atom/atom/releases/ "atom-$arch.$pkgtype") || fatal "Can't get package URL"
epm install "$PKG"
......@@ -19,6 +19,6 @@ repack=''
# we have workaround for their postinstall script, so always repack rpm package
[ "$($DISTRVENDOR -p)" = "deb" ] || repack='--repack'
PKG=$($EGET --list --latest https://github.com/brave/brave-browser/releases "$PKGNAME*.$arch.$pkgtype") || fatal "Can't get package URL"
PKG=$(epm tool eget --list --latest https://github.com/brave/brave-browser/releases "$PKGNAME*.$arch.$pkgtype") || fatal "Can't get package URL"
epm $repack install "$PKG"
......@@ -17,6 +17,6 @@ fi
arch=amd64
pkgtype=deb
PKG=$($EGET --list --latest https://github.com/deemru/chromium-gost/releases "chromium-gost-*linux-$arch.$pkgtype") || fatal "Can't get package URL"
PKG=$(epm tool eget --list --latest https://github.com/deemru/chromium-gost/releases "chromium-gost-*linux-$arch.$pkgtype") || fatal "Can't get package URL"
epm install "$PKG"
......@@ -10,7 +10,7 @@ pkgtype="$($DISTRVENDOR -p)"
# we have workaround for their postinstall script, so always repack rpm package
[ "$pkgtype" = "deb" ] || repack='--repack'
#PKG=$($EGET --list --latest https://www.duplicati.com/download "duplicati-*$pkgtype") || fatal "Can't get package URL"
PKG=$($EGET -O /dev/stdout https://updates.duplicati.com/beta/latest-installers.js | grep -i -o -E '"url": "(.+)"' | cut -d'"' -f4 | grep "duplicati.*$pkgtype")
#PKG=$(epm tool eget --list --latest https://www.duplicati.com/download "duplicati-*$pkgtype") || fatal "Can't get package URL"
PKG=$(epm tool eget -O /dev/stdout https://updates.duplicati.com/beta/latest-installers.js | grep -i -o -E '"url": "(.+)"' | cut -d'"' -f4 | grep "duplicati.*$pkgtype")
epm install $repack "$PKG"
......@@ -14,10 +14,10 @@ PKGURL="https://trial2.autodesk.com/NET17SWDLD/2017/EGLPRM/ESD/Autodesk_EAGLE_${
PKGDIR="$(mktemp -d)"
cd $PKGDIR || fatal
if ! $EGET $PKGURL ; then
if ! epm tool eget $PKGURL ; then
echo "It is possible you are blocked from USA, trying get from IPFS ..."
pkgname=$(basename $PKGURL)
$EGET -O $pkgname http://dhash.ru/ipfs/$IPFSHASH || fatal "Can't get $pkgname from IPFS."
epm tool eget -O $pkgname http://dhash.ru/ipfs/$IPFSHASH || fatal "Can't get $pkgname from IPFS."
fi
epm install --repack *.tar.gz
......
......@@ -16,7 +16,7 @@ epm assure wget || fatal
# hack due ОШИБКА: невозможно проверить сертификат app.ktalk.ru, выпущенный «CN=RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1,O=DigiCert Inc,C=US»
PKGDIR="$(mktemp -d)"
cd $PKGDIR || fatal
$EGET --no-check-certificate "$URL" || fatal
epm tool eget --no-check-certificate "$URL" || fatal
epm install *.AppImage
RES=$?
......
......@@ -10,7 +10,7 @@ DESCRIPTION='Obsidian from the official site'
arch=amd64
pkgtype=deb
PKG=$($EGET --list --latest https://github.com/obsidianmd/obsidian-releases/releases/ "$PKGNAME*$arch.$pkgtype") || fatal "Can't get package URL"
PKG=$(epm tool eget --list --latest https://github.com/obsidianmd/obsidian-releases/releases/ "$PKGNAME*$arch.$pkgtype") || fatal "Can't get package URL"
[ -n "$PKG" ] || fatal "Can't get package URL"
epm install "$PKG"
......@@ -18,11 +18,11 @@ case "$arch" in
;;
esac
PKG=$($EGET --list --latest https://www.sublimetext.com/download "sublime_text_build_*_$arch.tar.xz") || fatal "Can't get package URL"
PKG=$(epm tool eget --list --latest https://www.sublimetext.com/download "sublime_text_build_*_$arch.tar.xz") || fatal "Can't get package URL"
[ -n "$PKG" ] || fatal "Can't get package URL"
PKGFILE=$(echo /tmp/$(basename $PKGURL) | sed -e "s|/sublime_text_build_|/$PKGNAME-|")
$EGET -O $PKGFILE $PKGURL || exit
epm tool eget -O $PKGFILE $PKGURL || exit
epm install --repack "$PKG" || exit
......
......@@ -14,10 +14,10 @@ fi
[ "$($DISTRVENDOR -a)" != "x86_64" ] && echo "Only x86_64 is supported" && exit 1
PKGURL=$($EGET --list --latest https://github.com/telegramdesktop/tdesktop/releases "tsetup.*.tar.xz") #"
PKGURL=$(epm tool eget --list --latest https://github.com/telegramdesktop/tdesktop/releases "tsetup.*.tar.xz") #"
[ -n "$PKGURL" ] || fatal "Can't get package URL"
PKGFILE=$(echo /tmp/$(basename $PKGURL) | sed -e "s|/tsetup|/$PKGNAME|")
$EGET -O $PKGFILE $PKGURL || exit
epm tool eget -O $PKGFILE $PKGURL || exit
epm install --repack "$PKGFILE" || exit
......
......@@ -40,7 +40,7 @@ a='' awk 'BEGIN{desk=0}{ if(/^.*--system.*/&&desk==0){desk++} ; if (desk==0) {pr
. $SC
DDIR=$(mktemp -d)
cd $DDIR || fatal
$EGET $FFMPEG_URL_DEB
epm tool eget $FFMPEG_URL_DEB
SUITABLE_URLS=$FFMPEG_URL_DEB
a='' ar -x *.deb
a='' tar xf "data.tar.xz"
......
......@@ -30,7 +30,7 @@ esac
# epm uses eget to download * names
#epm install "https://repo.vivaldi.com/archive/deb/pool/main/$(epm print constructname $PKGNAME "*" $arch deb)"
PKGURL="$($EGET --list --latest https://vivaldi.com/ru/download "$(epm print constructname $PKGNAME "*" $arch deb)")" || fatal
PKGURL="$(epm tool eget --list --latest https://vivaldi.com/ru/download "$(epm print constructname $PKGNAME "*" $arch deb)")" || fatal
epm install $PKGURL || fatal
epm play vivaldi-codecs-ffmpeg-extra $BRANCH
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment