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