summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/data.py1
-rw-r--r--bitbake/lib/bb/tests/codeparser.py26
2 files changed, 27 insertions, 0 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index b0683c5180..1d21e00a1c 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -301,6 +301,7 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, d):
301 value += "\n_remove of %s" % r 301 value += "\n_remove of %s" % r
302 deps |= r2.references 302 deps |= r2.references
303 deps = deps | (keys & r2.execs) 303 deps = deps | (keys & r2.execs)
304 value = handle_contains(value, r2.contains, d)
304 return value 305 return value
305 306
306 if "vardepvalue" in varflags: 307 if "vardepvalue" in varflags:
diff --git a/bitbake/lib/bb/tests/codeparser.py b/bitbake/lib/bb/tests/codeparser.py
index f485204791..f1c4f618d8 100644
--- a/bitbake/lib/bb/tests/codeparser.py
+++ b/bitbake/lib/bb/tests/codeparser.py
@@ -412,6 +412,32 @@ esac
412 # Check final value 412 # Check final value
413 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['anothervalue', 'yetanothervalue', 'lastone']) 413 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['anothervalue', 'yetanothervalue', 'lastone'])
414 414
415 def test_contains_vardeps_override_operators(self):
416 # Check override operators handle dependencies correctly with the contains functionality
417 expr_plain = 'testval'
418 expr_prepend = '${@bb.utils.filter("TESTVAR1", "testval1", d)} '
419 expr_append = ' ${@bb.utils.filter("TESTVAR2", "testval2", d)}'
420 expr_remove = '${@bb.utils.contains("TESTVAR3", "no-testval", "testval", "", d)}'
421 # Check dependencies
422 self.d.setVar('ANOTHERVAR', expr_plain)
423 self.d.prependVar('ANOTHERVAR', expr_prepend)
424 self.d.appendVar('ANOTHERVAR', expr_append)
425 self.d.setVar('ANOTHERVAR:remove', expr_remove)
426 self.d.setVar('TESTVAR1', 'blah')
427 self.d.setVar('TESTVAR2', 'testval2')
428 self.d.setVar('TESTVAR3', 'no-testval')
429 deps, values = bb.data.build_dependencies("ANOTHERVAR", set(self.d.keys()), set(), set(), self.d)
430 self.assertEqual(sorted(values.splitlines()),
431 sorted([
432 expr_prepend + expr_plain + expr_append,
433 '_remove of ' + expr_remove,
434 'TESTVAR1{testval1} = Unset',
435 'TESTVAR2{testval2} = Set',
436 'TESTVAR3{no-testval} = Set',
437 ]))
438 # Check final value
439 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['testval2'])
440
415 #Currently no wildcard support 441 #Currently no wildcard support
416 #def test_vardeps_wildcards(self): 442 #def test_vardeps_wildcards(self):
417 # self.d.setVar("oe_libinstall", "echo test") 443 # self.d.setVar("oe_libinstall", "echo test")