Bug 46021 - please document what subset of shell is supported in os-release
Summary: please document what subset of shell is supported in os-release
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: Lennart Poettering
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-14 01:25 UTC by Simon McVittie
Modified: 2012-02-14 08:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.