Commit 718fdbf8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: add DISTRO_NAME

parent bc560064
...@@ -52,6 +52,7 @@ override_distrib() ...@@ -52,6 +52,7 @@ override_distrib()
local name="$(echo "$1" | sed -e 's|x86_64/||')" local name="$(echo "$1" | sed -e 's|x86_64/||')"
[ "$name" = "$1" ] && DIST_ARCH="x86" || DIST_ARCH="x86_64" [ "$name" = "$1" ] && DIST_ARCH="x86" || DIST_ARCH="x86_64"
DISTRIB_ID="$(echo "$name" | sed -e 's|/.*||')" DISTRIB_ID="$(echo "$name" | sed -e 's|/.*||')"
DISTRO_NAME="$DISTRIB_ID"
DISTRIB_RELEASE="$(echo "$name" | sed -e 's|.*/||')" DISTRIB_RELEASE="$(echo "$name" | sed -e 's|.*/||')"
[ "$DISTRIB_ID" = "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE='' [ "$DISTRIB_ID" = "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=''
...@@ -309,6 +310,7 @@ DISTRIB_CODENAME="" ...@@ -309,6 +310,7 @@ DISTRIB_CODENAME=""
if distro os-release ; then if distro os-release ; then
# shellcheck disable=SC1090 # shellcheck disable=SC1090
. $DISTROFILE . $DISTROFILE
DISTRO_NAME="$NAME"
DISTRIB_ID="$(normalize_name "$NAME")" DISTRIB_ID="$(normalize_name "$NAME")"
DISTRIB_RELEASE_ORIG="$VERSION_ID" DISTRIB_RELEASE_ORIG="$VERSION_ID"
DISTRIB_RELEASE="$VERSION_ID" DISTRIB_RELEASE="$VERSION_ID"
...@@ -321,6 +323,7 @@ if distro os-release ; then ...@@ -321,6 +323,7 @@ if distro os-release ; then
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)
DISTRO_NAME=$(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_FULL_RELEASE="$DISTRIB_RELEASE"
...@@ -846,6 +849,7 @@ case "$1" in ...@@ -846,6 +849,7 @@ case "$1" in
echo " -s|-n|--vendor-name - 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|--vendor-name - print base name of the distro (vendor name) (ubuntu for all Ubuntu family, alt for all ALT family) (see _vendor macros in rpm)"
echo " --pretty|--pretty-name - print pretty distro name" echo " --pretty|--pretty-name - print pretty distro name"
echo " -v | --base-version - print version of the distro" echo " -v | --base-version - print version of the distro"
echo " --distro-name - print distro name"
echo " --full-version - print full version of the distro" echo " --full-version - print full version of the distro"
echo " --codename (obsoleted) - print distro codename (focal for Ubuntu 20.04)" echo " --codename (obsoleted) - print distro codename (focal for Ubuntu 20.04)"
echo " --repo-name - print repository name (focal for Ubuntu 20.04)" echo " --repo-name - print repository name (focal for Ubuntu 20.04)"
...@@ -886,6 +890,10 @@ case "$1" in ...@@ -886,6 +890,10 @@ case "$1" in
override_distrib "$2" override_distrib "$2"
echo $DISTRIB_ID echo $DISTRIB_ID
;; ;;
--distro-name)
override_distrib "$2"
echo $DISTRO_NAME
;;
--codename) --codename)
override_distrib "$2" override_distrib "$2"
print_codename print_codename
......
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