diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-01-01 17:21:49 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-01-01 17:21:49 +0000 |
commit | ed0618025894ddc21172f924c96ce20495bc6e3a (patch) | |
tree | a7fba8d68f29b65ec47f21c8315469762cdfa899 | |
parent | 47efa71d303de7bb97c92156d2afaf45718cb0b6 (diff) |
base.bbclass: Allow base_contains to take an array of values to check for (from poky)
-rw-r--r-- | classes/base.bbclass | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index 249a25a218..504707e37b 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -41,12 +41,17 @@ def base_conditional(variable, checkvalue, truevalue, falsevalue, d): else: return falsevalue -def base_contains(variable, checkvalue, truevalue, falsevalue, d): - import bb - if bb.data.getVar(variable,d,1).find(checkvalue) != -1: - return truevalue - else: - return falsevalue +def base_contains(variable, checkvalues, truevalue, falsevalue, d): + import bb + matches = 0 + if type(checkvalues).__name__ == "str": + checkvalues = [checkvalues] + for value in checkvalues: + if bb.data.getVar(variable,d,1).find(value) != -1: + matches = matches + 1 + if matches == len(checkvalues): + return truevalue + return falsevalue def base_both_contain(variable1, variable2, checkvalue, d): import bb |