[bitbake-devel] question about BBVERSIONS OVERRIDES and PREFERRED_VERSION

Submitted by 张忠山 on Aug. 22, 2016, 9:56 a.m. | Patch ID: 129799

Details

Message ID d14aa6a9-7e47-55ff-aa24-d9e3892fa677@126.com
State New
Headers show

Commit Message

张忠山 Aug. 22, 2016, 9:56 a.m.
> Use 'bitbake test -e' to examine the overrides of var 'NAME', It is
> still not contain override for '1.1.7':
>
> #
> # $NAME [2 operations]
> #   override[develop]:set
> /home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:10
> #     "version is develop"
> #   override[pp]:set
> /home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:11
> #     "version is pp"
> # pre-expansion value:
> #   "version is pp"
> NAME="version is pp"
>
> Why ? I expect it should contain override for '1.1.7', like this:
>          override[1.1.7]:set
> /home/zzs/temp/bitbake-hello-world/main/../mylayer/test.bb:11
>          ....
> And I found all NAME_xxx, where xxx is [a-z] all OK? I has no idea about
> this.
> Anybody help me?
>

I found using the flowwing patch can solve my problem about override for 
'1.1.7':


============================================================

But, I'm not sure this work for other env.

I don't know why just lower case override permited in  this function.

Version string just include digit and point is very common, but 
islower() return False for these strings.

This behavior is intended or a bug?
Or has another way to solve my problem?

Patch hide | download patch | download mbox

============================================================
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index 2ab884b..216ba93 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -552,7 +552,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]:

Comments

Richard Purdie Aug. 25, 2016, 11:50 a.m.
On Mon, 2016-08-22 at 17:56 +0800, 张忠山 wrote:
> But, I'm not sure this work for other env.
> 
> I don't know why just lower case override permited in  this function.
> 
> Version string just include digit and point is very common, but 
> islower() return False for these strings.
> 
> This behavior is intended or a bug?
> Or has another way to solve my problem?

There was a discussion a while ago and we decided to only have bitbake
accept lower case overrides. I believe that the numeric piece isn't an
issue but the decimal point character probably is.

The reason for this was to try and avoid some of the performance costs
where any variable with a "_" in the name was potentially an override
character and this was costly for variable processing.

Cheers,

Richard
张忠山 Aug. 25, 2016, 12:25 p.m.
>> But, I'm not sure this work for other env.
>>
>> I don't know why just lower case override permited in  this function.
>>
>> Version string just include digit and point is very common, but
>> islower() return False for these strings.
>>
>> This behavior is intended or a bug?
>> Or has another way to solve my problem?
>
> There was a discussion a while ago and we decided to only have bitbake
> accept lower case overrides. I believe that the numeric piece isn't an
> issue but the decimal point character probably is.
>
> The reason for this was to try and avoid some of the performance costs
> where any variable with a "_" in the name was potentially an override
> character and this was costly for variable processing.
>

So, that's said I can't use override based upon version string just like 
'1.1.7'

If it is true, Does it means  'BBVERSIONS' has no sense?

I can't believe that  widly used version string format  can't be used as 
override!