Commit 94de8466 authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: allow override distr via DISTRNAMEOVERRIDE or latest arg

parent 6027c226
...@@ -76,23 +76,14 @@ print_bug_report_url() ...@@ -76,23 +76,14 @@ print_bug_report_url()
# allows x86_64/Distro/Version # allows x86_64/Distro/Version
override_distrib() override_distrib()
{ {
if [ -n "$1" ] ; then [ -n "$DISTRNAMEOVERRIDE" ] || DISTRNAMEOVERRIDE="$1"
local name="$(echo "$1" | sed -e 's|x86_64/||')" [ -n "$DISTRNAMEOVERRIDE" ] || return
[ "$name" = "$1" ] && DIST_ARCH="x86" || DIST_ARCH="x86_64"
DISTRIB_ID="$(echo "$name" | sed -e 's|/.*||')"
DISTRIB_RELEASE="$(echo "$name" | sed -e 's|.*/||')"
[ "$DISTRIB_ID" = "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=''
else
if [ -z "$DISTRNAME" ] ; then
return
fi
# if predefined DISTRNAME and possible DISTRVERSION local name="$(echo "$DISTRNAMEOVERRIDE" | sed -e 's|x86_64/||')"
DISTRIB_ID="$DISTRNAME" [ "$name" = "$DISTRNAMEOVERRIDE" ] && DIST_ARCH="x86" || DIST_ARCH="x86_64"
[ -n "$DISTRVERSION" ] && DISTRIB_RELEASE="$DISTRVERSION" DISTRIB_ID="$(echo "$name" | sed -e 's|/.*||')"
[ -n "$DISTRARCH" ] && DIST_ARCH="$DISTRARCH" DISTRIB_RELEASE="$(echo "$name" | sed -e 's|.*/||')"
# export DISTRCONTROL="$(get_service_manager)" [ "$DISTRIB_ID" = "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=''
fi
VENDOR_ID='' VENDOR_ID=''
PRETTY_NAME="$DISTRIB_ID" PRETTY_NAME="$DISTRIB_ID"
...@@ -959,9 +950,7 @@ EOF ...@@ -959,9 +950,7 @@ EOF
} }
if [ -n "$DISTRNAME" ] ; then override_distrib "$DISTRNAMEOVERRIDE"
override_distrib
fi
if [ -n "$*" ] ; then if [ -n "$*" ] ; then
eval lastarg=\${$#} eval lastarg=\${$#}
...@@ -977,7 +966,7 @@ if [ -n "$*" ] ; then ...@@ -977,7 +966,7 @@ if [ -n "$*" ] ; then
fi fi
# if without override # if without override
if [ -z "$DISTRIB_ID" ] && [ -z "$DISTRNAME" ] ; then if [ -z "$DISTRIB_ID" ] ; then
fill_distr_info fill_distr_info
[ -n "$DISTRIB_ID" ] || DISTRIB_ID="Generic" [ -n "$DISTRIB_ID" ] || DISTRIB_ID="Generic"
fi fi
......
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