Commit 82f89d67 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: replace $DISTRVENDOR with epm print info

parent 73a4c2d7
......@@ -2,12 +2,11 @@
The main purpose of any play.d script is to download and to install a package.
Allowed variables:
* $DISTRVENDOR (distro_info utility) (legacy, use epm print info instead of)
* $SUDO (will filled with 'sudo' command when running without root privilegies
Allowed commands:
* epm (run the same epm called from)
* epm print info (instead of $DISTRVENDOR)
* epm print info (instead of epm print info)
* epm tool eget (wget like utility)
* epm tool estrlist (string operations)
......
......@@ -6,14 +6,14 @@ DESCRIPTION="AIMP (Wine based audio player) from the official site"
. $(dirname $0)/common.sh
pkgtype="$($DISTRVENDOR -p)"
pkgtype="$(epm print info -p)"
if ! which wine ; then
epm play wine || fatal
fi
repack=''
[ "$($DISTRVENDOR -s)" = "alt" ] && repack='--repack'
[ "$(epm print info -s)" = "alt" ] && repack='--repack'
case $pkgtype in
deb)
......
......@@ -7,7 +7,7 @@ DESCRIPTION="AnyDesk from the official site"
. $(dirname $0)/common.sh
arch=$($DISTRVENDOR --distro-arch)
arch=$(epm print info --distro-arch)
case $arch in
x86_64|amd64)
arch=$arch ;;
......@@ -16,12 +16,12 @@ case $arch in
i586)
arch=i686 ;;
*)
fatal "Unsupported arch $arch for $($DISTRVENDOR -d)"
fatal "Unsupported arch $arch for $(epm print info -d)"
esac
# we have workaround for their postinstall script, so always repack rpm package
repack=''
[ "$($DISTRVENDOR -p)" = "deb" ] || repack='--repack'
[ "$(epm print info -p)" = "deb" ] || repack='--repack'
# current links:
# https://download.anydesk.com/rpm/anydesk_6.0.1-1_x86_64.rpm
......@@ -29,13 +29,13 @@ repack=''
# https://download.anydesk.com/deb/anydesk_6.0.1-1_amd64.deb
# general msk
#PKGMASK="$($DISTRVENDOR -p)/$(epm print constructname $PKGNAME "*" $arch '' '_')"
#PKGMASK="$(epm print info -p)/$(epm print constructname $PKGNAME "*" $arch '' '_')"
# TODO: hack with version, there are too many files
PKGMASK="$(epm print constructname $PKGNAME "[6-9].[1-9]*" $arch '' '_')"
# we miss obsoleted libpangox on ALT, so use RHEL8 build
# 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)"
#[ "$(epm print info -s)" = "alt" ] && PKGMASK="os-specific/rhel8/$(epm print constructname $PKGNAME "*" $arch)"
PKG="$(epm tool eget --list --latest https://download.anydesk.com/linux $PKGMASK)" || fatal "Can't get package URL"
......
......@@ -12,8 +12,8 @@ fi
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR -a)"
pkg="$($DISTRVENDOR -p)"
arch="$(epm print info -a)"
pkg="$(epm print info -p)"
# some locale depend troubles (ALT with bash 4 needs LANG=ru_RU.UTF-8, Ubuntu with bash 5 needs LANG=C.UTF-8)
#URL="https://мойассистент.рф/скачать"
......@@ -51,7 +51,7 @@ case $arch-$pkg in
URL="$(url_by_text "Скачать DEB пакет для ARM устройств")"
;;
*)
fatal "$($DISTRVENDOR -e) is not supported (arch $arch, package type is $pkg)"
fatal "$(epm print info -e) is not supported (arch $arch, package type is $pkg)"
;;
esac
......@@ -59,7 +59,7 @@ esac
# assistant: Требует: /lib/init/vars.sh но пакет не может быть установлен
# Требует: libyuv.so()(64bit) но пакет не может быть установлен
[ "$($DISTRVENDOR -s)" = "alt" ] && epmi --skip-installed fontconfig-disable-type1-font-for-assistant
[ "$(epm print info -s)" = "alt" ] && epmi --skip-installed fontconfig-disable-type1-font-for-assistant
# TODO: disable scripts (see /etc/eepm/pkgallowscripts.list)
LANG=ru_RU.UTF8 epm install "$URL" || exit
......
......@@ -15,8 +15,8 @@ done
. $(dirname $0)/common.sh
#arch=$($DISTRVENDOR --distro-arch)
#pkgtype=$($DISTRVENDOR -p)
#arch=$(epm print info --distro-arch)
#pkgtype=$(epm print info -p)
arch=amd64
pkgtype=deb
......
......@@ -22,7 +22,7 @@ arch=x86_64
pkgtype=rpm
repack=''
# we have workaround for their postinstall script, so always repack rpm package
[ "$($DISTRVENDOR -p)" = "deb" ] || repack='--repack'
[ "$(epm print info -p)" = "deb" ] || repack='--repack'
PKG=$(epm tool eget --list --latest https://github.com/brave/brave-browser/releases "$PKGNAME-[[:digit:]]*.$arch.$pkgtype")
......
......@@ -9,14 +9,14 @@ DESCRIPTION='' # echo " Remote desktop support for google-chrome & chromium" &&
echo "Note: It is not tested yet."
#arch=$($DISTRVENDOR --distro-arch)
#pkgtype=$($DISTRVENDOR -p)
#arch=$(epm print info --distro-arch)
#pkgtype=$(epm print info -p)
repack=''
arch=amd64
pkgtype=deb
# we have workaround for their postinstall script, so always repack rpm package
[ "$($DISTRVENDOR -p)" = "deb" ] || repack='--repack'
[ "$(epm print info -p)" = "deb" ] || repack='--repack'
PKG="https://dl.google.com/linux/direct/${PKGNAME}_current_$arch.$pkgtype"
......
......@@ -7,14 +7,14 @@ DESCRIPTION="The popular and trusted web browser by Google (Stable Channel) from
. $(dirname $0)/common.sh
#arch=$($DISTRVENDOR --distro-arch)
#pkgtype=$($DISTRVENDOR -p)
#arch=$(epm print info --distro-arch)
#pkgtype=$(epm print info -p)
repack=''
arch=amd64
pkgtype=deb
# we have workaround for their postinstall script, so always repack rpm package
[ "$($DISTRVENDOR -p)" = "deb" ] || repack='--repack'
[ "$(epm print info -p)" = "deb" ] || repack='--repack'
PKG="https://dl.google.com/linux/direct/google-chrome-stable_current_$arch.$pkgtype"
......
......@@ -13,8 +13,8 @@ if epm installed chromium-gost ; then
exit 0
fi
#arch=$($DISTRVENDOR --distro-arch)
#pkgtype=$($DISTRVENDOR -p)
#arch=$(epm print info --distro-arch)
#pkgtype=$(epm print info -p)
arch=amd64
pkgtype=deb
......
......@@ -9,7 +9,7 @@ TIPS="Run epm play code <version> to install specific version."
VERSION="$2"
arch="$($DISTRVENDOR -a)"
arch="$(epm print info -a)"
case "$arch" in
x86_64)
arch=x64
......@@ -25,7 +25,7 @@ case "$arch" in
esac
pkgtype="$($DISTRVENDOR -p)"
pkgtype="$(epm print info -p)"
# we have workaround for their postinstall script, so always repack rpm package
[ "$pkgtype" = "deb" ] || repack='--repack'
......
......@@ -8,8 +8,8 @@ DESCRIPTION="Codium from the official site"
VERSION="$2"
arch="$($DISTRVENDOR -a)"
pkgtype="$($DISTRVENDOR -p)"
arch="$(epm print info -a)"
pkgtype="$(epm print info -p)"
case "$arch-$pkgtype" in
x86_64-deb)
arch=amd64
......
......@@ -122,7 +122,7 @@ esac
# legacy compatibility and support direct run the script
if [ -z "$DISTRVENDOR" ] ; then
if [ -z "epm print info" ] ; then
export DISTRVENDOR="epm print info"
if [ -x "../bin/epm" ] ; then
export PATH="$(realpath ../bin):$PATH"
......
......@@ -5,7 +5,7 @@ DESCRIPTION="Duplicati from the official site"
. $(dirname $0)/common.sh
pkgtype="$($DISTRVENDOR -p)"
pkgtype="$(epm print info -p)"
# we have workaround for their postinstall script, so always repack rpm package
[ "$pkgtype" = "deb" ] || repack='--repack'
......
......@@ -6,20 +6,20 @@ DESCRIPTION="Geogebra 6 from the official site"
. $(dirname $0)/common.sh
arch=$($DISTRVENDOR --distro-arch)
arch=$(epm print info --distro-arch)
case $arch in
x86_64|amd64)
arch=$arch ;;
i686|i586|i386)
arch=i386 ;;
*)
fatal "Unsupported arch $arch for $($DISTRVENDOR -d)"
fatal "Unsupported arch $arch for $(epm print info -d)"
esac
pkgtype="$($DISTRVENDOR -p)"
pkgtype="$(epm print info -p)"
repack=''
[ "$($DISTRVENDOR -s)" = "alt" ] && repack='--repack'
[ "$(epm print info -s)" = "alt" ] && repack='--repack'
case $pkgtype in
deb)
......
......@@ -6,8 +6,8 @@ DESCRIPTION='Gitlab runner'
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR -a)"
pkg="$($DISTRVENDOR -p)"
arch="$(epm print info -a)"
pkg="$(epm print info -p)"
case "$arch" in
x86_64)
arch=amd64
......
......@@ -6,7 +6,7 @@ DESCRIPTION="LiteIDE is a simple, open source, cross-platform Go IDE. From the o
. $(dirname $0)/common.sh
archbit="$($DISTRVENDOR -b)"
archbit="$(epm print info -b)"
PKGURL=$(epm tool eget --list --latest https://github.com/visualfc/liteide/releases "liteidex*.linux$archbit-qt5*-system.tar.gz") #"
[ -n "$PKGURL" ] || fatal "Can't get package URL"
......
......@@ -21,7 +21,7 @@ serv mssql-server stop
dname="$(epm print info -s)"
dversion="$(epm print info -v)"
case "$($DISTRVENDOR -d)" in
case "$(epm print info -d)" in
AstraLinux*)
# we have libc++1-9, but this package requires libc++1
epm ar $DEBREPO ; epm update
......@@ -36,7 +36,7 @@ case "$($DISTRVENDOR -d)" in
epm install https://packages.microsoft.com/$dname/$dversion/mssql-server-2019/pool/main/m/mssql-server/mssql-server_1*_amd64.deb
;;
*)
fatal "$($DISTRVENDOR -d) is not supported yet."
fatal "$(epm print info -d) is not supported yet."
;;
esac
......
......@@ -14,7 +14,7 @@ fi
dname="$(epm print info -s)"
dversion="$(epm print info -v)"
case "$($DISTRVENDOR -d)" in
case "$(epm print info -d)" in
AstraLinux*)
epm install --skip-installed unixodbc || fatal
epm install https://packages.microsoft.com/debian/8/prod/pool/main/m/msodbcsql17/msodbcsql17_1*_amd64.deb
......@@ -33,7 +33,7 @@ case "$($DISTRVENDOR -d)" in
epm install https://packages.microsoft.com/$dname/$dversion/prod/pool/main/m/mssql-tools/mssql-tools_1*_amd64.deb
;;
*)
fatal "$($DISTRVENDOR -d) is not supported yet."
fatal "$(epm print info -d) is not supported yet."
;;
esac
......
......@@ -12,8 +12,8 @@ fi
. $(dirname $0)/common.sh
arch=$($DISTRVENDOR --distro-arch)
pkgtype=$($DISTRVENDOR -p)
arch=$(epm print info --distro-arch)
pkgtype=$(epm print info -p)
# /var/lib/dpkg/info/myoffice-standard-home-edition.postinst: line 62: xdg-desktop-menu: command not found
epm assure xdg-desktop-menu xdg-utils
......
......@@ -6,9 +6,9 @@ DESCRIPTION="ONLYOFFICE for Linux from the official site"
. $(dirname $0)/common.sh
#arch=$($DISTRVENDOR --distro-arch)
#arch=$(epm print info --distro-arch)
arch=amd64
#pkgtype=$($DISTRVENDOR -p)
#pkgtype=$(epm print info -p)
pkgtype=deb
PKG="https://download.onlyoffice.com/install/desktop/editors/linux/$(epm print constructname $PKGNAME "" $arch deb)"
......
......@@ -39,7 +39,7 @@ exit
else
# they put all branch here (rpm only): https://rpm.opera.com/rpm/
[ "$($DISTRVENDOR -s)" = "alt" ] && repack='--repack' || repack=''
[ "$(epm print info -s)" = "alt" ] && repack='--repack' || repack=''
epm install $repack https://rpm.opera.com/rpm/opera_$BRANCH-*-linux-release-x64-signed.rpm
fi
......@@ -6,7 +6,7 @@ DESCRIPTION="RuDesktop for Linux from the official site"
. $(dirname $0)/common.sh
case "$($DISTRVENDOR -d)" in
case "$(epm print info -d)" in
AstraLinux*)
PKGNAME=rudesktop-astra
;;
......
......@@ -7,7 +7,7 @@ PRODUCTALT="stable nightly"
. $(dirname $0)/common.sh
arch=$($DISTRVENDOR -a)
arch=$(epm print info -a)
pkgtype=deb
BRANCH=stable
......
......@@ -7,7 +7,7 @@ DESCRIPTION="Sferum for Linux from the official site"
. $(dirname $0)/common.sh
arch=$($DISTRVENDOR --distro-arch)
arch=$(epm print info --distro-arch)
case $arch in
x86_64|amd64)
arch=$arch ;;
......@@ -16,11 +16,11 @@ case $arch in
i586)
arch=i686 ;;
*)
fatal "Unsupported arch $arch for $($DISTRVENDOR -d)"
fatal "Unsupported arch $arch for $(epm print info -d)"
esac
repack=''
[ "$($DISTRVENDOR -s)" = "alt" ] && repack='--repack'
[ "$(epm print info -s)" = "alt" ] && repack='--repack'
#https://st.mycdn.me/static/sferum/latest/sferum-i386.deb
#https://st.mycdn.me/static/sferum/latest/sferum-amd64.deb
......@@ -29,4 +29,4 @@ repack=''
# can't use constructname due '-' before arch
#epm install "https://st.mycdn.me/static/sferum/latest/$(epm print constructname $PKGNAME '' $arch '' '-')"
epm $repack install "https://st.mycdn.me/static/sferum/latest/$PKGNAME-$arch.$($DISTRVENDOR -p)"
epm $repack install "https://st.mycdn.me/static/sferum/latest/$PKGNAME-$arch.$(epm print info -p)"
......@@ -7,8 +7,8 @@ DESCRIPTION="Skype for Linux - Stable/Release Version from the official site"
. $(dirname $0)/common.sh
#arch=$($DISTRVENDOR --distro-arch)
#pkgtype=$($DISTRVENDOR -p)
#arch=$(epm print info --distro-arch)
#pkgtype=$(epm print info -p)
pkgtype=deb
# don't used
......
......@@ -6,14 +6,14 @@ DESCRIPTION="Snap4Arduino binds Snap! and Arduino together"
. $(dirname $0)/common.sh
arch=$($DISTRVENDOR --distro-arch)
arch=$(epm print info --distro-arch)
case $arch in
x86_64|amd64)
arch=64 ;;
i586)
arch=32 ;;
*)
fatal "Unsupported arch $arch for $($DISTRVENDOR -d)"
fatal "Unsupported arch $arch for $(epm print info -d)"
esac
PKGURL=$(epm tool eget --list --latest https://github.com/bromagosa/Snap4Arduino/releases "Snap4Arduino_desktop-gnu-$arch_*.tar.gz") #"
......
......@@ -20,7 +20,7 @@ url_by_id_content()
epm tool eget -q -O- "$URL" | grep -A6 "$id_content" | tail -n1 | sed -e 's|.*"url": "||' -e 's|".*||'
}
case "$($DISTRVENDOR -e)" in
case "$(epm print info -e)" in
Ubuntu/20.04)
id_content='ubuntu20-id'
;;
......@@ -49,7 +49,7 @@ case "$($DISTRVENDOR -e)" in
id_content='win-id'
;;
*)
fatal "Unsupported system $($DISTRVENDOR -e)"
fatal "Unsupported system $(epm print info -e)"
;;
esac
......
......@@ -6,7 +6,7 @@ DESCRIPTION='Sublime Text 4 from the official site'
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR -a)"
arch="$(epm print info -a)"
case "$arch" in
x86_64)
arch=x64
......
......@@ -7,7 +7,7 @@ DESCRIPTION=''
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR -a)"
arch="$(epm print info -a)"
case "$arch" in
x86_64)
arch=x64
......
......@@ -7,7 +7,7 @@ DESCRIPTION="TamTam messenger from the official site"
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR --debian-arch)"
arch="$(epm print info --debian-arch)"
case "$arch" in
amd64)
;;
......
......@@ -9,7 +9,7 @@ DESCRIPTION='' #"Microsoft Teams for Linux from the official site"
. $(dirname $0)/common.sh
repack=''
pkgtype="$($DISTRVENDOR -p)"
pkgtype="$(epm print info -p)"
if [ "$pkgtype" = "deb" ] ; then
URL="https://packages.microsoft.com/repos/ms-teams/pool/main/t/teams"
......@@ -20,7 +20,7 @@ else
pkgtype=rpm
fi
if [ "$($DISTRVENDOR -s)" = "alt" ] ; then
if [ "$(epm print info -s)" = "alt" ] ; then
repack="--repack"
fi
......
......@@ -7,7 +7,7 @@ DESCRIPTION="Teamviewer from the official site"
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR -a)"
arch="$(epm print info -a)"
case "$arch" in
x86_64|x86)
;;
......@@ -23,7 +23,7 @@ esac
# See https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=teamviewer
repack=''
[ "$($DISTRVENDOR -p)" = "deb" ] || repack='--repack'
[ "$(epm print info -p)" = "deb" ] || repack='--repack'
# epm uses eget to download * names
epm $repack install "https://download.teamviewer.com/download/linux/$(epm print constructname $PKGNAME)" || exit
......
......@@ -7,7 +7,7 @@ DESCRIPTION="TrueConf client for Linux from the official site"
. $(dirname $0)/common.sh
epmopt=''
case "$($DISTRVENDOR -e)" in
case "$(epm print info -e)" in
ALTLinux/p10|ALTServer/10|ALTLinux/Sisyphus)
URL="https://mirror.trueconf.ru/altlinux/p10/x86_64/RPMS.non-free/trueconf-[0-9]*.x86_64.rpm"
epmopt='--direct --repack'
......@@ -32,7 +32,7 @@ case "$($DISTRVENDOR -e)" in
URL="https://mirror.trueconf.ru/rosa/R12/x86_64/testing/trueconf-[0-9].x86_64.rpm"
;;
*)
fatal "$($DISTRVENDOR -e) is not supported"
fatal "$(epm print info -e) is not supported"
esac
# --repack includes --noscripts
......
......@@ -8,7 +8,7 @@ DESCRIPTION='Generic VirtualHere USB Server from the official site'
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR -a)"
arch="$(epm print info -a)"
case "$arch" in
x86_64)
file="vhusbdx86_64"
......@@ -33,7 +33,7 @@ case "$arch" in
;;
esac
pkgtype="$($DISTRVENDOR -p)"
pkgtype="$(epm print info -p)"
tdir=$(mktemp -d)
trap "rm -fr $tdir" EXIT
......
......@@ -14,7 +14,7 @@ TIPS="Run 'epm play vivaldi snapshot' to install snapshot version of the browser
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR --debian-arch)"
arch="$(epm print info --debian-arch)"
case "$arch" in
amd64|aarch64|i386|armhf)
;;
......
......@@ -6,7 +6,7 @@ DESCRIPTION="VK Messenger from the official site"
. $(dirname $0)/common.sh
arch="$($DISTRVENDOR -a)"
arch="$(epm print info -a)"
case "$arch" in
x86)
arch="i686"
......
......@@ -7,7 +7,7 @@ DESCRIPTION="Zoom client from the official site"
. $(dirname $0)/common.sh
arch=$($DISTRVENDOR --distro-arch)
arch=$(epm print info --distro-arch)
case $arch in
x86_64|amd64)
version=latest
......@@ -17,13 +17,13 @@ case $arch in
version=5.4.53391.1108
arch=i686 ;;
*)
fatal "Unsupported arch $arch for $($DISTRVENDOR -d)"
fatal "Unsupported arch $arch for $(epm print info -d)"
esac
if [ "$($DISTRVENDOR -s)" = "alt" ] ; then
if [ "$(epm print info -s)" = "alt" ] ; then
epm install --repack https://zoom.us/client/$version/zoom_$arch.rpm
exit
fi
# TODO: there are more complex distro dependent url
epm install "https://zoom.us/client/latest/zoom_$arch.$($DISTRVENDOR -p)"
epm install "https://zoom.us/client/latest/zoom_$arch.$(epm print info -p)"
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