Commit 3028467d authored by Vitaly Lipatov's avatar Vitaly Lipatov

use exported vars instead of distr_info call

parent 39f809e9
...@@ -91,7 +91,7 @@ Examples: ...@@ -91,7 +91,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version $EPMVERSION Telegram: https://t.me/useepm https://wiki.etersoft.ru/Epm" echo "EPM package manager version $EPMVERSION Telegram: https://t.me/useepm https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)" echo "Running on $DISTRNAME/$DISTRVERSION ('$PMTYPE' package manager uses '$PKGFORMAT' package format)"
echo "Copyright (c) Etersoft 2012-2023" echo "Copyright (c) Etersoft 2012-2023"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
} }
......
...@@ -369,7 +369,7 @@ __epm_addrepo_alpine() ...@@ -369,7 +369,7 @@ __epm_addrepo_alpine()
__epm_addrepo_deb() __epm_addrepo_deb()
{ {
assure_exists apt-add-repository software-properties-common assure_exists apt-add-repository software-properties-common
local ad="$($DISTRVENDOR --distro-arch)" local ad="$DISTRARCH"
# TODO: move to distro_info # TODO: move to distro_info
local nd="$(lsb_release -cs)" local nd="$(lsb_release -cs)"
local repo="$*" local repo="$*"
......
...@@ -29,10 +29,10 @@ __epm_korinf_site_mask() { ...@@ -29,10 +29,10 @@ __epm_korinf_site_mask() {
# short hack to install needed package # short hack to install needed package
rhas "$MASK" "[-_]" || MASK="${MASK}[-_][0-9]" rhas "$MASK" "[-_]" || MASK="${MASK}[-_][0-9]"
# set arch for Korinf compatibility # set arch for Korinf compatibility
[ "$($DISTRVENDOR -a)" = "x86_64" ] && archprefix="x86_64/" [ "$DISTRARCH" = "x86_64" ] && archprefix="x86_64/"
local URL="$EPM_KORINF_REPO_URL/$archprefix$($DISTRVENDOR -e)" local URL="$EPM_KORINF_REPO_URL/$archprefix$DISTRNAME/$DISTRVERSION"
if ! eget --check "$URL" ; then if ! eget --check "$URL" ; then
tURL="$EPM_KORINF_REPO_URL/$archprefix$($DISTRVENDOR --vendor-name)/$($DISTRVENDOR --repo-name)" tURL="$EPM_KORINF_REPO_URL/$archprefix$BASEDISTRNAME/$DISTRREPONAME"
docmd eget --check "$tURL" && URL="$tURL" docmd eget --check "$tURL" && URL="$tURL"
fi fi
eget --list --latest "$URL/$MASK*.$PKGFORMAT" eget --list --latest "$URL/$MASK*.$PKGFORMAT"
......
...@@ -187,7 +187,7 @@ __epm_play_list() ...@@ -187,7 +187,7 @@ __epm_play_list()
local extra="$2" local extra="$2"
local i local i
local IGNOREi586 local IGNOREi586
local arch="$($DISTRVENDOR -a)" local arch="$DISTRARCH"
[ "$arch" = "x86_64" ] && IGNOREi586='' || IGNOREi586=1 [ "$arch" = "x86_64" ] && IGNOREi586='' || IGNOREi586=1
if [ -n "$short" ] ; then if [ -n "$short" ] ; then
...@@ -393,7 +393,7 @@ local psdir="$(realpath $CONFIGDIR/play.d)" ...@@ -393,7 +393,7 @@ local psdir="$(realpath $CONFIGDIR/play.d)"
local prsdir="$(realpath $CONFIGDIR/prescription.d)" local prsdir="$(realpath $CONFIGDIR/prescription.d)"
if [ -z "$1" ] ; then if [ -z "$1" ] ; then
[ -n "$short" ] || [ -n "$quiet" ] || echo "Available applications (for current arch $($DISTRVENDOR -a)):" [ -n "$short" ] || [ -n "$quiet" ] || echo "Available applications (for current arch $DISTRARCH):"
__epm_play_list $psdir __epm_play_list $psdir
exit exit
fi fi
...@@ -475,13 +475,13 @@ case "$1" in ...@@ -475,13 +475,13 @@ case "$1" in
;; ;;
--full-list-all) --full-list-all)
[ -n "$short" ] || [ -n "$quiet" ] || echo "Available applications (for current arch $($DISTRVENDOR -a)):" [ -n "$short" ] || [ -n "$quiet" ] || echo "Available applications (for current arch $DISTRARCH):"
__epm_play_list $psdir extra __epm_play_list $psdir extra
exit exit
;; ;;
--list-all|list-all) --list-all|list-all)
[ -n "$short" ] || [ -n "$quiet" ] || echo "Available applications (for current arch $($DISTRVENDOR -a)):" [ -n "$short" ] || [ -n "$quiet" ] || echo "Available applications (for current arch $DISTRARCH):"
__epm_play_list $psdir __epm_play_list $psdir
[ -n "$quiet" ] || [ -n "$*" ] && exit [ -n "$quiet" ] || [ -n "$*" ] && exit
echo echo
......
...@@ -288,7 +288,7 @@ construct_name() ...@@ -288,7 +288,7 @@ construct_name()
local ds="$5" local ds="$5"
local pds="$6" local pds="$6"
[ -n "$arch" ] || arch="$($DISTRVENDOR --distro-arch)" [ -n "$arch" ] || arch="$DISTRARCH"
[ -n "$pkgtype" ] || pkgtype="$PKGFORMAT" [ -n "$pkgtype" ] || pkgtype="$PKGFORMAT"
[ -n "$ds" ] || ds=$(get_pkg_name_delimiter $pkgtype) [ -n "$ds" ] || ds=$(get_pkg_name_delimiter $pkgtype)
[ -z "$pds" ] && pds="$ds" && [ "$pds" = "-" ] && pds="." [ -z "$pds" ] && pds="$ds" && [ "$pds" = "-" ] && pds="."
......
...@@ -39,7 +39,7 @@ exp_with_arch_suffix() ...@@ -39,7 +39,7 @@ exp_with_arch_suffix()
{ {
local suffix local suffix
[ "$($DISTRVENDOR -a)" = "x86_64" ] || { cat ; return ; } [ "$DISTRARCH" = "x86_64" ] || { cat ; return ; }
[ "$DISTRNAME" = "ROSA" ] && { cat ; return ; } [ "$DISTRNAME" = "ROSA" ] && { cat ; return ; }
# TODO: it is ok for ALT rpm to remove with this suffix # TODO: it is ok for ALT rpm to remove with this suffix
......
...@@ -189,9 +189,8 @@ __check_system() ...@@ -189,9 +189,8 @@ __check_system()
fi fi
if [ "$TO" != "Sisyphus" ] ; then if [ "$TO" != "Sisyphus" ] ; then
# we could miss DISTRVENDOR script during downgrade, reread # note: we get --base-version directy to get new version
set_distro_info if [ "$(DISTRVENDOR --base-version)" != "$TO" ] || epm installed altlinux-release-sisyphus >/dev/null ; then
if [ "$($DISTRVENDOR -v)" != "$TO" ] || epm installed altlinux-release-sisyphus >/dev/null ; then
warning "Current distro still is not $TO, or altlinux-release-sisyphus package is installed." warning "Current distro still is not $TO, or altlinux-release-sisyphus package is installed."
warning "Trying to fix with altlinux-release-$TO" warning "Trying to fix with altlinux-release-$TO"
docmd epm install altlinux-release-$TO docmd epm install altlinux-release-$TO
......
...@@ -39,12 +39,11 @@ get_task_arepo_packages() ...@@ -39,12 +39,11 @@ get_task_arepo_packages()
# use assure apt-repo before # use assure apt-repo before
get_task_packages() get_task_packages()
{ {
local arch="$($DISTRVENDOR -a)"
local tn local tn
for tn in $(tasknumber "$@") ; do for tn in $(tasknumber "$@") ; do
showcmd apt-repo list task "$tn" showcmd apt-repo list task "$tn"
a='' apt-repo list task "$tn" >/dev/null || continue a='' apt-repo list task "$tn" >/dev/null || continue
a='' apt-repo list task "$tn" a='' apt-repo list task "$tn"
[ "$arch" = "x86_64" ] && get_task_arepo_packages "$tn" [ "$DISTRARCH" = "x86_64" ] && get_task_arepo_packages "$tn"
done done
} }
...@@ -33,7 +33,7 @@ filter_out_installed_packages() ...@@ -33,7 +33,7 @@ filter_out_installed_packages()
case $PMTYPE in case $PMTYPE in
yum-rpm|dnf-rpm) yum-rpm|dnf-rpm)
if [ "$($DISTRVENDOR -a)" = "x86_64" ] && [ "$DISTRNAME" != "ROSA" ] ; then if [ "$DISTRARCH" = "x86_64" ] && [ "$DISTRNAME" != "ROSA" ] ; then
# shellcheck disable=SC2013 # shellcheck disable=SC2013
for i in $(cat) ; do for i in $(cat) ; do
is_installed "$(__print_with_arch_suffix $i .x86_64)" && continue is_installed "$(__print_with_arch_suffix $i .x86_64)" && continue
......
...@@ -19,12 +19,11 @@ ...@@ -19,12 +19,11 @@
is_warmup_allowed() is_warmup_allowed()
{ {
local MEM
# disable warming up until set warmup in /etc/eepm/eepm.conf # disable warming up until set warmup in /etc/eepm/eepm.conf
[ -n "$warmup" ] || return 1 [ -n "$warmup" ] || return 1
MEM="$($DISTRVENDOR -m)"
# disable warm if have no enough memory # disable warm if have no enough memory
[ "$MEM" -ge 1024 ] && return 0 [ "$DISTRMEMORY" -ge 1024 ] && return 0
warning "Skipping warmup bases due low memory size" warning "Skipping warmup bases due low memory size"
return 1 return 1
} }
......
...@@ -129,7 +129,7 @@ print_version() ...@@ -129,7 +129,7 @@ print_version()
local virt="$($DISTRVENDOR -i)" local virt="$($DISTRVENDOR -i)"
[ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)" [ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)"
echo "Service manager version $EPMVERSION https://wiki.etersoft.ru/Epm" echo "Service manager version $EPMVERSION https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE" echo "Running on $DISTRNAME/$DISTRVERSION $on_text with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012-2023" echo "Copyright (c) Etersoft 2012-2023"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
} }
......
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