[systemd-devel] CODENAME field in /etc/os-release
Unknown
peeters.simon at gmail.com
Wed Jan 13 05:23:24 PST 2016
On wo, 2016-01-13 at 13:04 +0100, Andreas Maier wrote:
> Johann,
> The description for /etc/os-release makes only this (quite informal)
> statement about the release code name:
>
> VERSION: A string identifying the operating system version,
> excluding any OS name information, possibly including a release code
> name, and suitable for presentation to the user.
>
> This does not even recommend what the syntax should be.
Because there is no syntax for it, similar to "This specification
assigns no meaning to the value of the string, the contents are at the
discretion of the distribution provider." even though it's mostly seen
in the form of "$versionnumber ($codename)", but relying on that would
be a bad idea.
> VERSION_ID, VARIANT_ID are definitely out of question for putting it
> there, and IMO also NAME and VARIANT.
>
> The statement about having it in PRETTY_NAME is even more informal
> than the one for VERSION.
>
> Bottom line is for someone deciding to add a release code name, there
> is room for doing that.
>
> However, I'm on the parsing side of this. From that perspective, this
> is not a question about having a possibility for putting the release
> code name somewhere, but where to expect it. A standard field named
> CODENAME is obviously superior compared to putting the release code
> name somewhere, even if there is a recommendation on the syntax (that
> people can and will choose not to follow, e.g. for compatibility
> reasons).
You shouldn't ask yourself where can i find the codename, but rather
what do I want to do with it?
- display it to the user or otherwise describe it in human readable
text? use PRETTY_NAME if the distribution isn't obvious, or VERSION if
it is.
- anything else? are you sure the codename is fit for the job?
codenames can be pretty much anything. and what would you do on systems
not using a codename? for example archlinux?
below the os-release of systems I (co)maintain:
----------
NAME="Arch Linux"
ID=arch
PRETTY_NAME="Arch Linux"
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
----------
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
----------
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="https://bugs.debian.org/"
----------
More information about the systemd-devel
mailing list