Commit 37774ff0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

distr_info: fix ID_LIKE support, update tests

parent 25ccdd49
......@@ -314,7 +314,7 @@ normalize_name()
"ROSA Chrome Desktop")
echo "ROSA"
;;
"MOS Desktop")
"MOS Desktop"|"MOS Panel")
echo "ROSA"
;;
"ROSA Enterprise Linux Desktop")
......@@ -375,7 +375,13 @@ if distro os-release ; then
# set by os-release:
#PRETTY_NAME
VENDOR_ID="$ID"
[ -n "$ID_LIKE" ] && VENDOR_ID="$ID_LIKE"
case "$VENDOR_ID" in
ubuntu|reld|rhel|astra)
;;
*)
[ -n "$ID_LIKE" ] && VENDOR_ID="$(echo "$ID_LIKE" | cut -d" " -f1)"
;;
esac
DISTRIB_FULL_RELEASE="$DISTRIB_RELEASE"
DISTRIB_CODENAME="$VERSION_CODENAME"
......@@ -436,6 +442,8 @@ case "$DISTRIB_ID" in
"ALTServer")
DISTRIB_ID="ALTLinux"
DISTRIB_CODENAME="$(echo p$DISTRIB_RELEASE | sed -e 's|\..*||')"
# TODO: change p10 to 10
DISTRIB_RELEASE="$DISTRIB_CODENAME"
;;
"ALTSPWorkstation")
DISTRIB_ID="ALTLinux"
......@@ -460,7 +468,7 @@ case "$DISTRIB_ID" in
DISTRIB_RELEASE="Sisyphus"
DISTRIB_CODENAME="$DISTRIB_RELEASE"
;;
"ROSA"|"MOSDesktop")
"ROSA"|"MOSDesktop"|"MOSPanel")
DISTRIB_FULL_RELEASE="$DISTRIB_CODENAME"
DISTRIB_CODENAME="$DISTRIB_RELEASE"
;;
......
ALTServer/10 alt/p10
ALTLinux/p10 alt/p10
MOC/10 alt/10
ALTLinux/p10 alt/p10
ROSA/2021.1 rosa/2021.1
ROSA/2021.1 rosa/2021.1
# Standard values
# Specification: https://www.freedesktop.org/software/systemd/man/os-release.html
NAME="MOS Panel"
ID=mos
ID_LIKE=rosa
PRETTY_NAME="MOS Panel 12"
CPE_NAME="cpe:/o:mos:rosa:2021.1"
META_CLASS=panel
VARIANT_ID=mos-panel
ANSI_COLOR="1;43"
VERSION="12"
VERSION_ID=2021.1
VERSION_CODENAME=12
HOME_URL="http://os.mos.ru"
LOGO=mos
BUG_REPORT_URL="https://os.mos.ru/git"
# ROSA-specific values
ROSA_OS_BRANCH=mos
ROSA_OS_PLATFORM="rosa2021.1"
ROSA_OS_PLATFORM_INTEGER=202110
ROSA_OS_TYPE=panel
ROSA_OS_VERSION=12
openSUSE Tumbleweed/20161014 opensuse tumbleweed/20161014
LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64"
DISTRIB_ID="openSUSE Tumbleweed"
DISTRIB_RELEASE="20161014"
DISTRIB_CODENAME=""
DISTRIB_DESCRIPTION="openSUSE Tumbleweed"
......@@ -15,9 +15,9 @@ for ROOTDIR in $(ls -1d etc/*) ; do
fi
le="$(cat $ROOTDIR/etalon.txt 2>/dev/null)"
if [ "$le" = "$idstr" ] ; then
printf "%23s -> %20s : %s\n" "$(basename $ROOTDIR)" "$idstr" "OK"
printf "%23s -> %30s : %s\n" "$(basename $ROOTDIR)" "$idstr" "OK"
else
printf "%23s -> %20s : %s\n" "$(basename $ROOTDIR)" "$idstr" "FAIL (expect $le)"
printf "%23s -> %30s : %s\n" "$(basename $ROOTDIR)" "$idstr" "FAIL (expect $le)"
fi
done
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