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