All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] enable override for suffix just include digit and dot
@ 2016-08-26  5:34 zzs213
  2016-08-26 14:44 ` Khem Raj
  0 siblings, 1 reply; 6+ messages in thread
From: zzs213 @ 2016-08-26  5:34 UTC (permalink / raw)
  To: bitbake-devel

From: 张忠山 <zzs213@126.com>

Without this patch, if we write these in recipe test.bb:

	NAME_1.1.7   = 'version is 1.1.7'
	NAME_develop = 'version is develop'

Use 'bitbake test -e' to observe 'NAME':
	#
	# $NAME [2 operations]
	#   override[develop]:set .../test.bb:10
	#     "version is develop"
	# pre-expansion value:
	#   "version is develop"
	NAME="version is develop"

Obviously, override for '1.1.7' missing.

Signed-off-by: 张忠山 <zzs213@126.com>
---
 lib/bb/data_smart.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index 59621b7..ea4ff80 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -559,7 +559,7 @@ class DataSmart(MutableMapping):
         # aka pay the cookie monster
         override = var[var.rfind('_')+1:]
         shortvar = var[:var.rfind('_')]
-        while override and override.islower():
+        while override and (override + 'a').islower():
             if shortvar not in self.overridedata:
                 self.overridedata[shortvar] = []
             if [var, override] not in self.overridedata[shortvar]:
@@ -637,7 +637,7 @@ class DataSmart(MutableMapping):
         if '_' in var:
             override = var[var.rfind('_')+1:]
             shortvar = var[:var.rfind('_')]
-            while override and override.islower():
+            while override and (override + 'a').islower():
                 try:
                     if shortvar in self.overridedata:
                         # Force CoW by recreating the list first
-- 
1.9.1




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

* Re: [PATCH] enable override for suffix just include digit and dot
  2016-08-26  5:34 [PATCH] enable override for suffix just include digit and dot zzs213
@ 2016-08-26 14:44 ` Khem Raj
  2016-08-27  7:32   ` 张忠山
  0 siblings, 1 reply; 6+ messages in thread
From: Khem Raj @ 2016-08-26 14:44 UTC (permalink / raw)
  To: zzs; +Cc: bitbake-devel

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

On Aug 25, 2016 10:35 PM, <zzs213@126.com> wrote:
>
> From: 张忠山 <zzs213@126.com>
>
> Without this patch, if we write these in recipe test.bb:
>
>         NAME_1.1.7   = 'version is 1.1.7'
>         NAME_develop = 'version is develop'
>
> Use 'bitbake test -e' to observe 'NAME':
>         #
>         # $NAME [2 operations]
>         #   override[develop]:set .../test.bb:10
>         #     "version is develop"
>         # pre-expansion value:
>         #   "version is develop"
>         NAME="version is develop"
>
> Obviously, override for '1.1.7' missing.

Dot is not allowed in variable names intentionally since its file extension
separator. I am not sure if its a good idea to allow it in variable names
>
> Signed-off-by: 张忠山 <zzs213@126.com>
> ---
>  lib/bb/data_smart.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
> index 59621b7..ea4ff80 100644
> --- a/lib/bb/data_smart.py
> +++ b/lib/bb/data_smart.py
> @@ -559,7 +559,7 @@ class DataSmart(MutableMapping):
>          # aka pay the cookie monster
>          override = var[var.rfind('_')+1:]
>          shortvar = var[:var.rfind('_')]
> -        while override and override.islower():
> +        while override and (override + 'a').islower():
>              if shortvar not in self.overridedata:
>                  self.overridedata[shortvar] = []
>              if [var, override] not in self.overridedata[shortvar]:
> @@ -637,7 +637,7 @@ class DataSmart(MutableMapping):
>          if '_' in var:
>              override = var[var.rfind('_')+1:]
>              shortvar = var[:var.rfind('_')]
> -            while override and override.islower():
> +            while override and (override + 'a').islower():
>                  try:
>                      if shortvar in self.overridedata:
>                          # Force CoW by recreating the list first
> --
> 1.9.1
>
>
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel

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

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

* Re: [PATCH] enable override for suffix just include digit and dot
  2016-08-26 14:44 ` Khem Raj
@ 2016-08-27  7:32   ` 张忠山
  2016-08-27 19:55     ` Christopher Larson
  0 siblings, 1 reply; 6+ messages in thread
From: 张忠山 @ 2016-08-27  7:32 UTC (permalink / raw)
  Cc: bitbake-devel

>>
>> Without this patch, if we write these in recipe test.bb <http://test.bb>:
>>
>>         NAME_1.1.7   = 'version is 1.1.7'
>>         NAME_develop = 'version is develop'
>>
>> Use 'bitbake test -e' to observe 'NAME':
>>         #
>>         # $NAME [2 operations]
>>         #   override[develop]:set .../test.bb:10 <http://test.bb:10>
>>         #     "version is develop"
>>         # pre-expansion value:
>>         #   "version is develop"
>>         NAME="version is develop"
>>
>> Obviously, override for '1.1.7' missing.
>
> Dot is not allowed in variable names intentionally since its file
> extension separator. I am not sure if its a good idea to allow it in
> variable names

Since we can use the path delimeter '/' in override like 
'virtual/kernel'. Why we can't use dot in override.

And bitbkae would add 'PV'(which default to '1.0' in OE) to 'OVERRIDES'. 
So using dot in override may not be an issue.

In bitbake manual, It said we can use BBVERSIONS and override to let 
sigle recipe support multiple package version

If we can't use dot in override, Howto use BBVERSIONS? Use embedded 
python code to set var according version? But it is ugly tahn using 
override!




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

* Re: [PATCH] enable override for suffix just include digit and dot
  2016-08-27  7:32   ` 张忠山
@ 2016-08-27 19:55     ` Christopher Larson
  2016-08-29  2:50       ` 张忠山
  2016-08-29  5:58       ` 张忠山
  0 siblings, 2 replies; 6+ messages in thread
From: Christopher Larson @ 2016-08-27 19:55 UTC (permalink / raw)
  To: 张忠山; +Cc: bitbake-devel

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

On Sat, Aug 27, 2016 at 12:32 AM, 张忠山 <zzs213@126.com> wrote:

> Without this patch, if we write these in recipe test.bb <http://test.bb>:
>>>
>>>         NAME_1.1.7   = 'version is 1.1.7'
>>>         NAME_develop = 'version is develop'
>>>
>>> Use 'bitbake test -e' to observe 'NAME':
>>>         #
>>>         # $NAME [2 operations]
>>>         #   override[develop]:set .../test.bb:10 <http://test.bb:10>
>>>         #     "version is develop"
>>>         # pre-expansion value:
>>>         #   "version is develop"
>>>         NAME="version is develop"
>>>
>>> Obviously, override for '1.1.7' missing.
>>>
>>
>> Dot is not allowed in variable names intentionally since its file
>> extension separator. I am not sure if its a good idea to allow it in
>> variable names
>>
>
> Since we can use the path delimeter '/' in override like 'virtual/kernel'.
> Why we can't use dot in override.
>
> And bitbkae would add 'PV'(which default to '1.0' in OE) to 'OVERRIDES'.
> So using dot in override may not be an issue.
>
> In bitbake manual, It said we can use BBVERSIONS and override to let sigle
> recipe support multiple package version
>
> If we can't use dot in override, Howto use BBVERSIONS? Use embedded python
> code to set var according version? But it is ugly tahn using override!


OVERRIDES .= ":pv-${@'${PV}'.replace('.', '_')}"
FOO_pv-1_1_7 = "bar"

It's worth noting that you're likely the first person to try using it since
I added the feature. oe-core moved to a policy where only one version of a
given recipe is kept in most cases, making it less useful.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

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

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

* Re: [PATCH] enable override for suffix just include digit and dot
  2016-08-27 19:55     ` Christopher Larson
@ 2016-08-29  2:50       ` 张忠山
  2016-08-29  5:58       ` 张忠山
  1 sibling, 0 replies; 6+ messages in thread
From: 张忠山 @ 2016-08-29  2:50 UTC (permalink / raw)
  To: bitbake-devel

在 2016年08月28日 03:55, Christopher Larson 写道:
>
> On Sat, Aug 27, 2016 at 12:32 AM, 张忠山 <zzs213@126.com
> <mailto:zzs213@126.com>> wrote:
>
>             Without this patch, if we write these in recipe test.bb
>             <http://test.bb> <http://test.bb>:
>
>                     NAME_1.1.7   = 'version is 1.1.7'
>                     NAME_develop = 'version is develop'
>
>             Use 'bitbake test -e' to observe 'NAME':
>                     #
>                     # $NAME [2 operations]
>                     #   override[develop]:set .../test.bb:10
>             <http://test.bb:10> <http://test.bb:10>
>                     #     "version is develop"
>                     # pre-expansion value:
>                     #   "version is develop"
>                     NAME="version is develop"
>
>             Obviously, override for '1.1.7' missing.
>
>
>         Dot is not allowed in variable names intentionally since its file
>         extension separator. I am not sure if its a good idea to allow it in
>         variable names
>
>
>     Since we can use the path delimeter '/' in override like
>     'virtual/kernel'. Why we can't use dot in override.
>
>     And bitbkae would add 'PV'(which default to '1.0' in OE) to
>     'OVERRIDES'. So using dot in override may not be an issue.
>
>     In bitbake manual, It said we can use BBVERSIONS and override to let
>     sigle recipe support multiple package version
>
>     If we can't use dot in override, Howto use BBVERSIONS? Use embedded
>     python code to set var according version? But it is ugly tahn using
>     override!
>
>
> OVERRIDES .= ":pv-${@'${PV}'.replace('.', '_')}"
> FOO_pv-1_1_7 = "bar"
>

Thanks for your suggestion.
But I found just the folowwing enough:

	OVERRIDES .= ":pv-${PV}"
	FOO_pv-1.1.7 = 'bar'

So I wonder why we must avoid dot in override. Is it mandatory or a 
convention.

And is there some taboos with 'override'. If any it should appear in 
manual I think.

> It's worth noting that you're likely the first person to try using it
> since I added the feature. oe-core moved to a policy where only one
> version of a given recipe is kept in most cases, making it less useful.

Does this means 'BBVERSIONS' would disappeared in th future?





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

* Re: [PATCH] enable override for suffix just include digit and dot
  2016-08-27 19:55     ` Christopher Larson
  2016-08-29  2:50       ` 张忠山
@ 2016-08-29  5:58       ` 张忠山
  1 sibling, 0 replies; 6+ messages in thread
From: 张忠山 @ 2016-08-29  5:58 UTC (permalink / raw)
  To: bitbake-devel

>
> OVERRIDES .= ":pv-${@'${PV}'.replace('.', '_')}"
> FOO_pv-1_1_7 = "bar"
>

Now I test my project fully, Found can't use ${PV} to generate OVERRIDES.

Because of BBVERSIONS, When generage OVERRIDES, the PV not setted 
according PREFFERED_VERSION_xxx. It use the setting in bitbake.conf 
which default to `1.0`

So maybe this worked:

OVERRIDES .= ":pv-${PREFERRED_VERSION_${PN}}"
FOO_pv-1_1_7 = "bar"




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

end of thread, other threads:[~2016-08-29  5:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-26  5:34 [PATCH] enable override for suffix just include digit and dot zzs213
2016-08-26 14:44 ` Khem Raj
2016-08-27  7:32   ` 张忠山
2016-08-27 19:55     ` Christopher Larson
2016-08-29  2:50       ` 张忠山
2016-08-29  5:58       ` 张忠山

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.