Skip to contentSkip to conversation

data_smart: Don't cache/process capitalised overrides

PATCH In review Richard Purdie 3 participants 3 messages May 12, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 data_smart: Don't cache/process capitalised overrides

Bitbake now only processes overrides which are lowercase since this allows variables like SRC_URI not to pollute the cache.

There was a corner case where XXX_append_SomeThing was still being processed (yet XXX_append_SomeThing_SomeOtherThing would not be).

This patch ensures we're consistent and only process lowercase _append/_prepend and _remove operators too.

---
 lib/bb/data_smart.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/data_smart.py +1 -1
index 7dc1c68..7b09af5 100644
@@ -39,7 +39,7 @@ from bb.COW  import COWDictBase
 logger = logging.getLogger("BitBake.Data")
 
 __setvar_keyword__ = ["_append", "_prepend", "_remove"]
-__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>.*))?$')
+__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
 __expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}")
 __expand_python_regexp__ = re.compile(r"\${@.+?}")
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 8 lines · Richard Purdie

Bitbake now only processes overrides which are lowercase since this allows variables like SRC_URI not to pollute the cache.

There was a corner case where XXX_append_SomeThing was still being processed (yet XXX_append_SomeThing_SomeOtherThing would not be).

This patch ensures we're consistent and only process lowercase _append/_prepend and _remove operators too.

I just realized a ramification of the previous and this change. It prevents recipe/package names with uppercase characters in them since overrides will no longer be processed (like pn-....).

This is something that probably should be documented. "Don't use uppercase!"

--Mark

Quoted 19 lines
---
 lib/bb/data_smart.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/data_smart.py +1 -1
index 7dc1c68..7b09af5 100644
@@ -39,7 +39,7 @@ from bb.COW  import COWDictBase
 logger = logging.getLogger("BitBake.Data")
 
 __setvar_keyword__ = ["_append", "_prepend", "_remove"]
-__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>.*))?$')
+__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
 __expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}")
 __expand_python_regexp__ = re.compile(r"\${@.+?}")
 
#2 lore raw
Quoted 7 lines · Mark Hatle
Quoted 6 lines · Richard Purdie

Bitbake now only processes overrides which are lowercase since this allows variables like SRC_URI not to pollute the cache.

There was a corner case where XXX_append_SomeThing was still being processed (yet XXX_append_SomeThing_SomeOtherThing would not be).

Quoted 6 lines
Quoted 2 lines

This patch ensures we're consistent and only process lowercase _append/_prepend and _remove operators too.

I just realized a ramification of the previous and this change. It prevents recipe/package names with uppercase characters in them since overrides will no longer be processed (like pn-....).

Did recipe/package names *ever* work with uppercase letters? Certainly not for me!

Quoted 25 lines

This is something that probably should be documented. "Don't use uppercase!"

--Mark

Quoted 19 lines
---
 lib/bb/data_smart.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/data_smart.py +1 -1
index 7dc1c68..7b09af5 100644
@@ -39,7 +39,7 @@ from bb.COW  import COWDictBase
 logger = logging.getLogger("BitBake.Data")
 
 __setvar_keyword__ = ["_append", "_prepend", "_remove"]
-__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>.*))?$')
+__setvar_regexp__ = re.compile('(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
 __expand_var_regexp__ = re.compile(r"\${[^{}@\n\t :]+}")
 __expand_python_regexp__ = re.compile(r"\${@.+?}")
 
Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------