Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use VERSION_ID from os-release #1585

Merged
merged 1 commit into from
Jan 21, 2024

Conversation

brycekahle
Copy link
Contributor

VERSION_ID is more appropriate for scripts and other usages, since VERSION can contain spaces and codenames

from os-release manpage:

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 field
           is optional.

           Examples: "VERSION=17", "VERSION="17 (Beefy Miracle)"".

 VERSION_ID=
           A lower-case string (mostly numeric, no spaces or other
           characters outside of 0–9, a–z, ".", "_" and "-") identifying
           the operating system version, excluding any OS name
           information or release code name, and suitable for processing
           by scripts or usage in generated filenames. This field is
           optional.

           Examples: "VERSION_ID=17", "VERSION_ID=11.04".

`VERSION_ID` is more appropriate for scripts and other usages, since `VERSION` can contain spaces and codenames

from `os-release` manpage:
```
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 field
           is optional.

           Examples: "VERSION=17", "VERSION="17 (Beefy Miracle)"".

 VERSION_ID=
           A lower-case string (mostly numeric, no spaces or other
           characters outside of 0–9, a–z, ".", "_" and "-") identifying
           the operating system version, excluding any OS name
           information or release code name, and suitable for processing
           by scripts or usage in generated filenames. This field is
           optional.

           Examples: "VERSION_ID=17", "VERSION_ID=11.04".
```
Copy link
Owner

@shirou shirou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I first looked at this PR, I thought that this change would have a very broad impact.

However, after reading the comments in the linked PR, I realized that it wouldn't really matter, since the priority for os-release is lower than for files like lsb-release and distribution files(e.g. debian_version).

One thing to note is that there is an issue #1576. In this case, os-release has the highest priority, so the impact will be significant. However, I approve this PR because I think this version value should actually return the VERSION_ID.

Your contribution is very much appreciated.

@shirou shirou merged commit 9de1a42 into shirou:master Jan 21, 2024
19 checks passed
@brycekahle brycekahle deleted the bryce.kahle/os-release-version-id branch January 22, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants