diff options
author | Richard Purdie <richard@openedhand.com> | 2006-07-24 09:22:17 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-07-24 09:22:17 +0000 |
commit | 3e472bb56da70d183073ef6a4f0e6f8d8ab31165 (patch) | |
tree | d892ad706b56cc91188c53230df9c0592a93e174 /meta/classes | |
parent | 2ca73b57dc7df958ce80bfa3c2e3dc3fc18950b5 (diff) | |
download | poky-3e472bb56da70d183073ef6a4f0e6f8d8ab31165.tar.gz |
base.bbclass: Add base_contains function - Can be used to check if a string is present in a variable.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@547 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/base.bbclass | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 8467ebddc2..6f23a846fa 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -39,6 +39,13 @@ def base_conditional(variable, checkvalue, truevalue, falsevalue, d): | |||
39 | else: | 39 | else: |
40 | return falsevalue | 40 | return falsevalue |
41 | 41 | ||
42 | def base_contains(variable, checkvalue, truevalue, falsevalue, d): | ||
43 | import bb | ||
44 | if bb.data.getVar(variable,d,1).find(checkvalue) != -1: | ||
45 | return truevalue | ||
46 | else: | ||
47 | return falsevalue | ||
48 | |||
42 | DEPENDS_prepend="${@base_dep_prepend(d)} " | 49 | DEPENDS_prepend="${@base_dep_prepend(d)} " |
43 | 50 | ||
44 | def base_set_filespath(path, d): | 51 | def base_set_filespath(path, d): |