Commit 7263d396 authored by Vitaly Lipatov's avatar Vitaly Lipatov

optimization: use eval distr_info --print-eepm-env instead of separated calls

parent d63a5430
......@@ -104,17 +104,6 @@ echon()
}
# Used DISTRNAME
set_target_pkg_env()
{
[ -n "$DISTRNAME" ] || fatal "Missing DISTRNAME in set_target_pkg_env."
local ver="$DISTRVERSION"
[ -n "$ver" ] && ver="/$ver"
PKGFORMAT=$($DISTRVENDOR -p "$DISTRNAME$ver")
PKGVENDOR=$($DISTRVENDOR -s "$DISTRNAME$ver")
RPMVENDOR=$($DISTRVENDOR -n "$DISTRNAME$ver")
}
# Print command line and run command line
showcmd()
{
......@@ -682,13 +671,14 @@ set_distro_info()
[ -x $DISTRVENDOR ] || DISTRVENDOR=distro_info
export DISTRVENDOR
[ -n "$DISTRNAME" ] || DISTRNAME=$($DISTRVENDOR -d) || fatal "Can't get distro name."
[ -n "$DISTRVERSION" ] || DISTRVERSION=$($DISTRVENDOR -v)
if [ -z "$DISTRARCH" ] ; then
DISTRARCH=$($DISTRVENDOR --distro-arch)
fi
DISTRCONTROL="$($DISTRVENDOR -y)"
[ -n "$BASEDISTRNAME" ] || BASEDISTRNAME=$($DISTRVENDOR -s)
# export pack of variables:
# BASEDISTRNAME
# DISTRNAME
# DISTRVERSION
# DISTRARCH
# DISTRCONTROL
# PMTYPE
eval $($DISTRVENDOR --print-eepm-env)
[ -n "$TMPDIR" ] || TMPDIR="/tmp"
# TODO: improve BIGTMPDIR conception
......@@ -703,7 +693,6 @@ set_pm_type()
{
local CMD
set_distro_info
set_target_pkg_env
# override package manager detection result
if [ -n "$EPM_BACKEND" ] ; then
......@@ -716,7 +705,6 @@ if [ -n "$FORCEPM" ] ; then
return
fi
PMTYPE="$($DISTRVENDOR -g $DISTRNAME/$DISTRVERSION)"
}
is_active_systemd()
......
......@@ -72,7 +72,6 @@ set_service_type()
local CMD
set_distro_info
set_target_pkg_env
case "$DISTRCONTROL" in
sysvinit)
......
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