[oe-commits] org.oe.dev base.bbclass: Add base_contains and base_both_containg - useful functions for the new task-machine code (from poky)

rpurdie commit openembedded-commits at lists.openembedded.org
Sun Aug 27 17:41:37 UTC 2006


base.bbclass: Add base_contains and base_both_containg - useful functions for the new task-machine code (from poky)

Author: rpurdie at openembedded.org
Branch: org.openembedded.dev
Revision: f900468546ce476c281192f5010a08f07b323823
ViewMTN: http://monotone.openembedded.org/revision.psp?id=f900468546ce476c281192f5010a08f07b323823
Files:
1
classes/base.bbclass
Diffs:

#
# mt diff -r33001ff22f95feed0938740b8c095071b9518441 -rf900468546ce476c281192f5010a08f07b323823
#
# 
# 
# patch "classes/base.bbclass"
#  from [bc7a22ad35d2ec55c38bad6a61878d4627da6397]
#    to [a58f0f75a39985a4ab32dc7da237ee3c27a143f6]
# 
============================================================
--- classes/base.bbclass	bc7a22ad35d2ec55c38bad6a61878d4627da6397
+++ classes/base.bbclass	a58f0f75a39985a4ab32dc7da237ee3c27a143f6
@@ -40,6 +40,20 @@ def base_conditional(variable, checkvalu
 	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_both_contain(variable1, variable2, checkvalue, d):
+       import bb
+       if bb.data.getVar(variable1,d,1).find(checkvalue) != -1 and bb.data.getVar(variable2,d,1).find(checkvalue) != -1:
+               return checkvalue
+       else:
+               return ""
+
 DEPENDS_prepend="${@base_dep_prepend(d)} "
 
 def base_set_filespath(path, d):






More information about the Openembedded-commits mailing list