Explorar o código

bitbake: data_smart: Allow colon in variable expansion regex

Now that ":" is a valid character in variable key names, it needs to be
allowed by the variable expansion code too, to match.

(Bitbake rev: 019251649a38754d5877759d13b664e28dea77de)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie %!s(int64=3) %!d(string=hai) anos
pai
achega
d41af446fe
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 1 1
      bitbake/lib/bb/data_smart.py
  2. 2 2
      bitbake/lib/bb/tests/codeparser.py

+ 1 - 1
bitbake/lib/bb/data_smart.py

@@ -28,7 +28,7 @@ logger = logging.getLogger("BitBake.Data")
 
 __setvar_keyword__ = ["_append", "_prepend", "_remove"]
 __setvar_regexp__ = re.compile(r'(?P<base>.*?)(?P<keyword>_append|_prepend|_remove)(_(?P<add>[^A-Z]*))?$')
-__expand_var_regexp__ = re.compile(r"\${[a-zA-Z0-9\-_+./~]+?}")
+__expand_var_regexp__ = re.compile(r"\${[a-zA-Z0-9\-_+./~:]+?}")
 __expand_python_regexp__ = re.compile(r"\${@.+?}")
 __whitespace_split__ = re.compile(r'(\s)')
 __override_regexp__ = re.compile(r'[a-z0-9]+')

+ 2 - 2
bitbake/lib/bb/tests/codeparser.py

@@ -111,9 +111,9 @@ ${D}${libdir}/pkgconfig/*.pc
         self.assertExecs(set(["sed"]))
 
     def test_parameter_expansion_modifiers(self):
-        # - and + are also valid modifiers for parameter expansion, but are
+        # -,+ and : are also valid modifiers for parameter expansion, but are
         # valid characters in bitbake variable names, so are not included here
-        for i in ('=', ':-', ':=', '?', ':?', ':+', '#', '%', '##', '%%'):
+        for i in ('=', '?', '#', '%', '##', '%%'):
             name = "foo%sbar" % i
             self.parseExpression("${%s}" % name)
             self.assertNotIn(name, self.references)