Commit b3305e0c authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: add --full-version

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