src-openEuler/openEuler-release 是为用户和程序提供系统版本等信息的软件包,此前在 openEuler 社区中即有过讨论。
我最近在修 src-openEuler/anaconda 时,发现 openEuler 22.03 LTS 与 openEuler 22.03 LTS SP1 对于相同字段存在不同格式,具体如下:
# openEuler 22.03 LTS NAME="openEuler" VERSION="22.03 LTS" ID="openEuler" VERSION_ID="22.03" PRETTY_NAME="openEuler 22.03 LTS" ANSI_COLOR="0;31"
# openEuler 22.03 LTS SP1 NAME="openEuler" VERSION="22.03 (LTS-SP1)" ID="openEuler" VERSION_ID="22.03" PRETTY_NAME="openEuler 22.03 (LTS-SP1)" ANSI_COLOR="0;31"
后者的rpm包里又是另一种格式:
main> SELECT name, version, arch from packages WHERE name = 'openEuler-release' openEuler-release,22.03LTS_SP1,x86_64
有关 /etc/os-release 文件的命名约定在如下链接可以查到: https://www.freedesktop.org/software/systemd/man/os-release.html 按照我的理解,简而言之,括号中的值应该是开发代号(VERSION_CODENAME)或者变体版本(VARIANT),例如:
# Ubuntu 20.04.4 LTS NAME="Ubuntu" VERSION="20.04.4 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.4 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal
# Fedora 32 NAME=Fedora VERSION="32 (Workstation Edition)" ID=fedora VERSION_ID=32 PRETTY_NAME="Fedora 32 (Workstation Edition)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:32" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f32/system-administrators-guide/" SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=32 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=32 PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" VARIANT="Workstation Edition" VARIANT_ID=workstation
形如 LTS 或 LTS SP1 的后缀,笔者认为应属于版本的一部分,既非开发代号(与数字版本号同义)又非变体版本(共享同一版本软件仓库的不同发布组合),置于括号中不妥当。希望了解一下更多开发者和社区用户的看法。
另附 openEuler 20.03 系列中的同一文件,供参考:
# openEuler 20.03 LTS NAME="openEuler" VERSION="20.03 (LTS)" ID="openEuler" VERSION_ID="20.03" PRETTY_NAME="openEuler 20.03 (LTS)" ANSI_COLOR="0;31"
# openEuler 20.03 LTS SP1
NAME="openEuler"
VERSION="20.03 (LTS-SP1)"
ID="openEuler"
VERSION_ID="20.03"
PRETTY_NAME="openEuler 20.03 (LTS-SP1)"
ANSI_COLOR="0;31"
此邮件关联如下仓库评论: https://gitee.com/src-openeuler/openEuler-release/commit/6deb344b23835711455...