From 3e472bb56da70d183073ef6a4f0e6f8d8ab31165 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 24 Jul 2006 09:22:17 +0000 Subject: 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 --- meta/classes/base.bbclass | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 8467ebddc..6f23a846f 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): -- cgit v1.2.3