Commit b3305e0c authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: add --full-version

parent f2b41372
......@@ -288,6 +288,8 @@ fill_distr_info()
PRETTY_NAME=""
DISTRIB_ID=""
DISTRIB_RELEASE=""
DISTRIB_FULL_RELEASE=""
DISTRIB_RELEASE_ORIG=""
DISTRIB_CODENAME=""
# Default detection by /etc/os-release
......@@ -302,13 +304,14 @@ if distro os-release ; then
# set by os-release:
#PRETTY_NAME
VENDOR_ID="$ID"
DISTRIB_FULL_RELEASE=$DISTRIB_RELEASE
DISTRIB_FULL_RELEASE="$DISTRIB_RELEASE"
DISTRIB_CODENAME="$VERSION_CODENAME"
elif distro lsb-release ; then
DISTRIB_ID=$(cat $DISTROFILE | get_var DISTRIB_ID)
DISTRIB_RELEASE=$(cat $DISTROFILE | get_var DISTRIB_RELEASE)
DISTRIB_RELEASE="$(cat $DISTROFILE | get_var DISTRIB_RELEASE)"
DISTRIB_RELEASE_ORIG="$DISTRIB_RELEASE"
DISTRIB_FULL_RELEASE="$DISTRIB_RELEASE"
DISTRIB_CODENAME=$(cat $DISTROFILE | get_var DISTRIB_CODENAME)
PRETTY_NAME=$(cat $DISTROFILE | get_var DISTRIB_DESCRIPTION)
fi
......@@ -329,10 +332,8 @@ case "$VENDOR_ID" in
esac
;;
"astra")
DISTRIB_RELEASE=$(normalize_version3 "$DISTRIB_RELEASE_ORIG" | sed -e 's|_.*||')
[ "$VARIANT" = "orel" ] && DISTRIB_ID="AstraLinuxCE" || DISTRIB_ID="AstraLinuxSE"
#[ "$DISTRIB_RELEASE" = "1.17" ] && DISTRIB_RELEASE="$VERSION_ID"
#DISTRIB_RELEASE="$VERSION_CODENAME"
DISTRIB_RELEASE=$(normalize_version2 "$DISTRIB_RELEASE_ORIG" | sed -e 's|_.*||')
DISTRIB_FULL_RELEASE=$(normalize_version3 "$DISTRIB_RELEASE_ORIG" | sed -e 's|_.*||')
;;
esac
......@@ -349,7 +350,7 @@ case "$DISTRIB_ID" in
# ;;
"ALTSPWorkstation")
DISTRIB_ID="ALTLinux"
case "$DISTRIB_FULL_RELEASE" in
case "$DISTRIB_RELEASE_ORIG" in
8.0|8.1)
;;
8.2|8.3)
......@@ -815,7 +816,8 @@ case "$1" in
echo " -s|-n - print base name of the distro (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (see _vendor macros in rpm)"
echo " -y - print running service manager"
echo " --pretty - print pretty distro name"
echo " -v - print version of distro"
echo " -v - print version of the distro"
echo " --full-version - print full version of the distro"
echo " -V - print the utility version"
echo "Run without args to print all information."
exit 0
......@@ -877,7 +879,11 @@ case "$1" in
;;
-v)
override_distrib "$2"
echo $DISTRIB_RELEASE
echo "$DISTRIB_RELEASE"
;;
--full-version)
override_distrib "$2"
echo "$DISTRIB_FULL_RELEASE"
;;
-s|-n)
override_distrib "$2"
......
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