summaryrefslogtreecommitdiff
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-07-24 09:22:17 +0000
committerRichard Purdie <richard@openedhand.com>2006-07-24 09:22:17 +0000
commit3e472bb56da70d183073ef6a4f0e6f8d8ab31165 (patch)
treed892ad706b56cc91188c53230df9c0592a93e174 /meta/classes
parent2ca73b57dc7df958ce80bfa3c2e3dc3fc18950b5 (diff)
downloadopenembedded-core-3e472bb56da70d183073ef6a4f0e6f8d8ab31165.tar.gz
openembedded-core-3e472bb56da70d183073ef6a4f0e6f8d8ab31165.tar.bz2
openembedded-core-3e472bb56da70d183073ef6a4f0e6f8d8ab31165.zip
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.bbclass7
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):
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
+
DEPENDS_prepend="${@base_dep_prepend(d)} "
def base_set_filespath(path, d):