summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb')
-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 c09d9b04bb..45411055b9 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -310,6 +310,7 @@ def build_dependencies(key, keys, shelldeps, varflagsexcl, ignored_vars, d):
310 value += "\n_remove of %s" % r 310 value += "\n_remove of %s" % r
311 deps |= r2.references 311 deps |= r2.references
312 deps = deps | (keys & r2.execs) 312 deps = deps | (keys & r2.execs)
313 value = handle_contains(value, r2.contains, exclusions, d)
313 return value 314 return value
314 315
315 if "vardepvalue" in varflags: 316 if "vardepvalue" in varflags:
diff --git a/bitbake/lib/bb/tests/codeparser.py b/bitbake/lib/bb/tests/codeparser.py
index 71ed382ab8..36ed4e196b 100644
--- a/bitbake/lib/bb/tests/codeparser.py
+++ b/bitbake/lib/bb/tests/codeparser.py
@@ -430,6 +430,32 @@ esac
430 self.assertEqual(deps, set(["TESTVAR2"])) 430 self.assertEqual(deps, set(["TESTVAR2"]))
431 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['testval3', 'anothervalue']) 431 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['testval3', 'anothervalue'])
432 432
433 def test_contains_vardeps_override_operators(self):
434 # Check override operators handle dependencies correctly with the contains functionality
435 expr_plain = 'testval'
436 expr_prepend = '${@bb.utils.filter("TESTVAR1", "testval1", d)} '
437 expr_append = ' ${@bb.utils.filter("TESTVAR2", "testval2", d)}'
438 expr_remove = '${@bb.utils.contains("TESTVAR3", "no-testval", "testval", "", d)}'
439 # Check dependencies
440 self.d.setVar('ANOTHERVAR', expr_plain)
441 self.d.prependVar('ANOTHERVAR', expr_prepend)
442 self.d.appendVar('ANOTHERVAR', expr_append)
443 self.d.setVar('ANOTHERVAR:remove', expr_remove)
444 self.d.setVar('TESTVAR1', 'blah')
445 self.d.setVar('TESTVAR2', 'testval2')
446 self.d.setVar('TESTVAR3', 'no-testval')
447 deps, values = bb.data.build_dependencies("ANOTHERVAR", set(self.d.keys()), set(), set(), set(), self.d)
448 self.assertEqual(sorted(values.splitlines()),
449 sorted([
450 expr_prepend + expr_plain + expr_append,
451 '_remove of ' + expr_remove,
452 'TESTVAR1{testval1} = Unset',
453 'TESTVAR2{testval2} = Set',
454 'TESTVAR3{no-testval} = Set',
455 ]))
456 # Check final value
457 self.assertEqual(self.d.getVar('ANOTHERVAR').split(), ['testval2'])
458
433 #Currently no wildcard support 459 #Currently no wildcard support
434 #def test_vardeps_wildcards(self): 460 #def test_vardeps_wildcards(self):
435 # self.d.setVar("oe_libinstall", "echo test") 461 # self.d.setVar("oe_libinstall", "echo test")