Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] os-release: remove double-quotes around VERSION_ID value
@ 2016-02-12 12:15 Dmitry Rozhkov
  2016-02-12 12:28 ` Joshua G Lock
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Dmitry Rozhkov @ 2016-02-12 12:15 UTC (permalink / raw)
  To: openembedded-core

man 5 os-release states that VERSION_ID is

"
a lower-case string (mostly numeric, no spaces or other
characters outside of 0-9, a-z, ".", "_" and "-")
identifying the operating system version
"

This becomes crucial when ClearLinux's software
update mechanism is integrated into builds, because
its client side ignores VERSION_ID's value if it
doesn't conform the definition.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@intel.com>
---
 meta/recipes-core/os-release/os-release.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
index df19ca2..1f0df9e 100644
--- a/meta/recipes-core/os-release/os-release.bb
+++ b/meta/recipes-core/os-release/os-release.bb
@@ -29,7 +29,11 @@ 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))
+                if field == "VERSION_ID":
+                    format_str = '{0}={1}\n'
+                else:
+                    format_str = '{0}="{1}"\n'
+                f.write(format_str.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')
-- 
2.5.0

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-13 10:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 12:15 [PATCH] os-release: remove double-quotes around VERSION_ID value Dmitry Rozhkov
2016-02-12 12:28 ` Joshua G Lock
2016-02-12 13:10   ` Richard Purdie
2016-02-12 22:08     ` Joshua G Lock
2016-02-12 12:54 ` Olof Johansson
2016-02-12 14:21 ` Burton, Ross
2016-02-12 17:14 ` Maciej Borzecki
2016-02-12 21:49   ` Joshua G Lock
2016-02-13 10:01     ` Maciej Borzecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox