]> code.ossystems Code Review - openembedded-core.git/commitdiff
os-release: put double-quotes around variable contents
authorCraig McQueen <craig.mcqueen@innerrange.com>
Thu, 15 Oct 2015 05:13:09 +0000 (16:13 +1100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 16 Nov 2015 11:20:11 +0000 (11:20 +0000)
This makes the resulting /etc/os-release file have valid shell
assignment syntax. This makes it loadable by a shell script, using the
'source' command:

    source /etc/os-release

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/os-release/os-release.bb

index c690b82b2e4dda63a65c3c600e22698f492a9a93..df19ca216facb5ebb53bd9d56aee905fb8a07689 100644 (file)
@@ -29,7 +29,7 @@ python do_compile () {
         for field in d.getVar('OS_RELEASE_FIELDS', True).split():
             value = d.getVar(field, True)
             if value:
-                f.write('{0}={1}\n'.format(field, value))
+                f.write('{0}="{1}"\n'.format(field, value))
     if d.getVar('RPM_SIGN_PACKAGES', True) == '1':
         rpm_gpg_pubkey = d.getVar('RPM_GPG_PUBKEY', True)
         bb.utils.mkdirhier('${B}/rpm-gpg')