Message278861
Can you elaborate the expected API? /etc/os-release is not a single line, but a list of variables. Example on my Fedora 24:
---
$ cat /etc/os-release
NAME=Fedora
VERSION="24 (Workstation Edition)"
ID=fedora
VERSION_ID=24
PRETTY_NAME="Fedora 24 (Workstation Edition)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:24"
HOME_URL="https://fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=24
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=24
PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
VARIANT="Workstation Edition"
VARIANT_ID=workstation
---
I think that you should return a dictionary key=>value. Maybe we can simply return an empty dictionary if the file doesn't exist or cannot be read (but raise an error on parsing error).
FYI On Fedora 24, /etc/os-release is in fact a symbolic link to a symbolic link:
---
$ ls -l /etc/os-release
lrwxrwxrwx. 1 root root 21 24 juin 03:25 /etc/os-release -> ../usr/lib/os-release
$ ls -l /usr/lib/os-release
lrwxrwxrwx. 1 root root 37 13 sept. 09:51 /usr/lib/os-release -> ./os.release.d/os-release-workstation
$ ls -l /usr/lib/os.release.d/os-release-workstation
-rw-r--r--. 1 root root 518 24 juin 03:25 /usr/lib/os.release.d/os-release-workstation
---
See also systemd manual page:
https://www.freedesktop.org/software/systemd/man/os-release.html |
|
Date |
User |
Action |
Args |
2016-10-18 12:37:21 | vstinner | set | recipients:
+ vstinner, doko, christian.heimes, matrixise, cstratak |
2016-10-18 12:37:21 | vstinner | set | messageid: <1476794241.84.0.382759889326.issue28468@psf.upfronthosting.co.za> |
2016-10-18 12:37:21 | vstinner | link | issue28468 messages |
2016-10-18 12:37:21 | vstinner | create | |
|