All of lore.kernel.org
 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

* Re: [PATCH] os-release: remove double-quotes around VERSION_ID value
  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 12:54 ` Olof Johansson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Joshua G Lock @ 2016-02-12 12:28 UTC (permalink / raw)
  To: openembedded-core

On Fri, 2016-02-12 at 14:15 +0200, Dmitry Rozhkov wrote:
> 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>

I think we probably want this change, but we will also need to change
the default assignment of VERSION_ID to match the rules:

"Variable assignment values must be enclosed in double or single quotes
if they include spaces, semicolons or other special characters outside
of A-Z, a-z, 0-9."

By default VERSION_ID is assigned DISTRO_VERSION, which contains
invalid characters for this field in both OE Core (defaultsetup distro
uses "nodistro.0") and meta-yocto (poky distro uses something like
"2.0+snapshot-${DATE}" during development and something like "1.8.1" on
a release).

Thoughts on changing these?

Regards,

Joshua

> ---
>  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	[flat|nested] 9+ messages in thread

* Re: [PATCH] os-release: remove double-quotes around VERSION_ID value
  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 12:54 ` Olof Johansson
  2016-02-12 14:21 ` Burton, Ross
  2016-02-12 17:14 ` Maciej Borzecki
  3 siblings, 0 replies; 9+ messages in thread
From: Olof Johansson @ 2016-02-12 12:54 UTC (permalink / raw)
  To: Dmitry Rozhkov; +Cc: openembedded-core

On 16-02-12 14:15 +0200, Dmitry Rozhkov wrote:
> 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.

On Debian, the value is quoted:

VERSION_ID="8"

So I think the documentation refers to the value of VERSION_ID,
with the surrounding quotes not being part of the *value*.

-- 
olofjn


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

* Re: [PATCH] os-release: remove double-quotes around VERSION_ID value
  2016-02-12 12:28 ` Joshua G Lock
@ 2016-02-12 13:10   ` Richard Purdie
  2016-02-12 22:08     ` Joshua G Lock
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2016-02-12 13:10 UTC (permalink / raw)
  To: Joshua G Lock, openembedded-core

On Fri, 2016-02-12 at 12:28 +0000, Joshua G Lock wrote:
> On Fri, 2016-02-12 at 14:15 +0200, Dmitry Rozhkov wrote:
> > 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>
> 
> I think we probably want this change, but we will also need to change
> the default assignment of VERSION_ID to match the rules:
> 
> "Variable assignment values must be enclosed in double or single
> quotes
> if they include spaces, semicolons or other special characters
> outside
> of A-Z, a-z, 0-9."
> 
> By default VERSION_ID is assigned DISTRO_VERSION, which contains
> invalid characters for this field in both OE Core (defaultsetup
> distro
> uses "nodistro.0") and meta-yocto (poky distro uses something like
> "2.0+snapshot-${DATE}" during development and something like "1.8.1"
> on
> a release).
> 
> Thoughts on changing these?

nodistro.0 is ok isn't it?

We should probably manipulate the string when writing this, "+" -> "-"
and "A-Z" -> "a-z"?

Not sure I want to change the high level values just due to this.

Cheers,

Richard


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

* Re: [PATCH] os-release: remove double-quotes around VERSION_ID value
  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 12:54 ` Olof Johansson
@ 2016-02-12 14:21 ` Burton, Ross
  2016-02-12 17:14 ` Maciej Borzecki
  3 siblings, 0 replies; 9+ messages in thread
From: Burton, Ross @ 2016-02-12 14:21 UTC (permalink / raw)
  To: Dmitry Rozhkov; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 562 bytes --]

On 12 February 2016 at 12:15, Dmitry Rozhkov <dmitry.rozhkov@intel.com>
wrote:

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

To quote from the paragraph above:

"Variable assignment values should be enclosed in double or single quotes
if they include spaces, semicolons or other special characters outside of
A-Z, a-z, 0-9."

If the Clear updater is failing to handle quoted values then that's a bug
in their parser.

Ross

[-- Attachment #2: Type: text/html, Size: 1209 bytes --]

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

* Re: [PATCH] os-release: remove double-quotes around VERSION_ID value
  2016-02-12 12:15 [PATCH] os-release: remove double-quotes around VERSION_ID value Dmitry Rozhkov
                   ` (2 preceding siblings ...)
  2016-02-12 14:21 ` Burton, Ross
@ 2016-02-12 17:14 ` Maciej Borzecki
  2016-02-12 21:49   ` Joshua G Lock
  3 siblings, 1 reply; 9+ messages in thread
From: Maciej Borzecki @ 2016-02-12 17:14 UTC (permalink / raw)
  To: openembedded-core, Dmitry Rozhkov

> Dnia 12 luty 2016 o 13:15 Dmitry Rozhkov <dmitry.rozhkov@intel.com>
> napisał(a):
>
>
> 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.

Is this integration work already published somewhere? I'm interested
in trying out swupdate with Yocto, but the lack of publicly available
repo is kind of holding this back (yes, I'm ware of SRPMs).

When I was asking on the mailing list about Yocto and ClearLinux back
in January[1][2] Arjan responded that there was a mismatch between the
development models used by Clear and Yocto and that there was a number
of reasons for not using Yocto tooling in Clear. Now, I'm still
interested in getting swupdate to work outside of Clear, so I took
some time to go through the source code to figure out the update
mechanism[3]. IMO making it work with Yocto should not be a
significant effort, even in embedded applications.

Do you mind sharing the some details if there is a larger plan for
getting Clear closer to Yocto/OE?

[1]. https://lists.clearlinux.org/pipermail/dev/2016-January/000150.html
[2]. https://lists.clearlinux.org/pipermail/dev/2016-January/000151.html
[3]. https://lists.clearlinux.org/pipermail/dev/2016-January/000159.html

--
Maciej Borzęcki
Senior Software Engineer at Open-RnD Sp. z o.o.
www.open-rnd.pl, Facebook, Twitter


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

* Re: [PATCH] os-release: remove double-quotes around VERSION_ID value
  2016-02-12 17:14 ` Maciej Borzecki
@ 2016-02-12 21:49   ` Joshua G Lock
  2016-02-13 10:01     ` Maciej Borzecki
  0 siblings, 1 reply; 9+ messages in thread
From: Joshua G Lock @ 2016-02-12 21:49 UTC (permalink / raw)
  To: openembedded-core

On Fri, 2016-02-12 at 18:14 +0100, Maciej Borzecki wrote:
> > Dnia 12 luty 2016 o 13:15 Dmitry Rozhkov <dmitry.rozhkov@intel.com>
> > napisał(a):
> > 
> > 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.
> 
> Is this integration work already published somewhere? I'm interested
> in trying out swupdate with Yocto, but the lack of publicly available
> repo is kind of holding this back (yes, I'm ware of SRPMs).

I'm working on integrating swupd into OE-Core, it's a work in progress
and so far nothing has been published (the work is not yet in a
functional state).

The recipes we are currently using for swupd-server and swupd-client
use the src.rpm's from clearlinux.org

> Do you mind sharing the some details if there is a larger plan for
> getting Clear closer to Yocto/OE?

We have a couple of tickets in the Yocto Project bugzilla[1][2] which
give an overview of the approach I'm taking for this initial
implementation.

The approach is fairly conservative in an attempt to get something
usable integrated that lets us work with the swupd developers to iron
out issues with utilising swupd from within OE.

Regards,

Joshua

1. https://bugzilla.yoctoproject.org/show_bug.cgi?id=9039
2. https://bugzilla.yoctoproject.org/show_bug.cgi?id=9040




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

* Re: [PATCH] os-release: remove double-quotes around VERSION_ID value
  2016-02-12 13:10   ` Richard Purdie
@ 2016-02-12 22:08     ` Joshua G Lock
  0 siblings, 0 replies; 9+ messages in thread
From: Joshua G Lock @ 2016-02-12 22:08 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

On Fri, 2016-02-12 at 13:10 +0000, Richard Purdie wrote:
> On Fri, 2016-02-12 at 12:28 +0000, Joshua G Lock wrote:
> > On Fri, 2016-02-12 at 14:15 +0200, Dmitry Rozhkov wrote:
> > > 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>
> > 
> > I think we probably want this change, but we will also need to
> > change
> > the default assignment of VERSION_ID to match the rules:
> > 
> > "Variable assignment values must be enclosed in double or single
> > quotes
> > if they include spaces, semicolons or other special characters
> > outside
> > of A-Z, a-z, 0-9."
> > 
> > By default VERSION_ID is assigned DISTRO_VERSION, which contains
> > invalid characters for this field in both OE Core (defaultsetup
> > distro
> > uses "nodistro.0") and meta-yocto (poky distro uses something like
> > "2.0+snapshot-${DATE}" during development and something like
> > "1.8.1"
> > on
> > a release).
> > 
> > Thoughts on changing these?
> 
> nodistro.0 is ok isn't it?

It is yes, I wasn't paying enough attention earlier.

> 
> We should probably manipulate the string when writing this, "+" -> "-
> "
> and "A-Z" -> "a-z"?

That sounds like a good solution to me.

Regards,

Joshua


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

* Re: [PATCH] os-release: remove double-quotes around VERSION_ID value
  2016-02-12 21:49   ` Joshua G Lock
@ 2016-02-13 10:01     ` Maciej Borzecki
  0 siblings, 0 replies; 9+ messages in thread
From: Maciej Borzecki @ 2016-02-13 10:01 UTC (permalink / raw)
  To: openembedded-core, Joshua G Lock

> Dnia 12 luty 2016 o 22:49 Joshua G Lock <joshua.g.lock@linux.intel.com>
> napisał(a):
>
>
> On Fri, 2016-02-12 at 18:14 +0100, Maciej Borzecki wrote:
> > > Dnia 12 luty 2016 o 13:15 Dmitry Rozhkov <dmitry.rozhkov@intel.com>
> > > napisał(a):
> > > 
> > > 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.
> >
> > Is this integration work already published somewhere? I'm interested
> > in trying out swupdate with Yocto, but the lack of publicly available
> > repo is kind of holding this back (yes, I'm ware of SRPMs).
>
> I'm working on integrating swupd into OE-Core, it's a work in progress
> and so far nothing has been published (the work is not yet in a
> functional state).
>
> The recipes we are currently using for swupd-server and swupd-client
> use the src.rpm's from clearlinux.org
>
> > Do you mind sharing the some details if there is a larger plan for
> > getting Clear closer to Yocto/OE?
>
> We have a couple of tickets in the Yocto Project bugzilla[1][2] which
> give an overview of the approach I'm taking for this initial
> implementation.
>
> The approach is fairly conservative in an attempt to get something
> usable integrated that lets us work with the swupd developers to iron
> out issues with utilising swupd from within OE.
>

Thanks for taking the time to respond. I'll keep an eye on both BZ issues.

--
Maciej Borzęcki
Senior Software Engineer at Open-RnD Sp. z o.o.
www.open-rnd.pl, Facebook, Twitter


^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.