[bitbake-devel] [PATCH] enable override for suffix just include digit and dot

Khem Raj raj.khem at gmail.com
Fri Aug 26 14:44:40 UTC 2016


On Aug 25, 2016 10:35 PM, <zzs213 at 126.com> wrote:
>
> From: 张忠山 <zzs213 at 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 at 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 at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160826/5d11dda7/attachment-0002.html>


More information about the bitbake-devel mailing list