Bug 46021

Summary: please document what subset of shell is supported in os-release
Product: systemd Reporter: Simon McVittie <smcv>
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Simon McVittie 2012-02-14 01:25:34 UTC
os-release is documented like this:

"The basic file format of os-release is a newline-separated list of environment-like shell-compatible variable assignments. It is possible to source the configuration from shell scripts, however, beyond mere variable assignments no shell features are supported"

This doesn't say whether double-quoted and/or single-quoted strings are supported, whether the usual set of '\' escapes inside double-quoted strings are supported, or whether this sort of thing (which would work in a shell) works:

    # expands to: O'Reilly "Undocumentable" Linux
    PRETTY_NAME="O'Reilly "'"Undocumentable" Linux'

My guess would be that "", '' and \ escapes should work, but multiple concatenated quoted strings don't/shouldn't.

It'd also be nice if shell-style comments (unquoted #) were supported, as they are in many configuration files (even those with ad-hoc formats).
Comment 1 Simon McVittie 2012-02-14 01:57:35 UTC
Context: I've opened <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659853> asking Debian's base-files package (the one with /etc/debian_version) to also provide /etc/os-release.
Comment 2 Lennart Poettering 2012-02-14 08:36:01 UTC
Fixed in git.
Comment 3 Lennart Poettering 2012-02-14 08:36:24 UTC
And thanks for pushing this in Debian! Much appreciated!

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.