From: Chris Larson Date: Thu, 16 Sep 2004 01:48:20 +0000 (+0000) Subject: Merge openembedded@openembedded.bkbits.net:packages X-Git-Tag: Release-2010-05/1~17145 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=924a57acf3e4eb1f930d8879854514a965a8e277;p=openembedded.git Merge openembedded@openembedded.bkbits.net:packages into handhelds.org:/home/kergoth/code/oe/packages 2004/09/15 21:47:28-04:00 handhelds.org!kergoth Add filter() and filter_out() convenience functions (def'd, in the python namespace, not the oe metadata one). BKrev: 4148f0e4hjS7vY7OQhMymq8dtyQMdg --- diff --git a/classes/base.oeclass b/classes/base.oeclass index 8c50abb2cd..4896510567 100644 --- a/classes/base.oeclass +++ b/classes/base.oeclass @@ -39,6 +39,22 @@ def base_set_filespath(path, d): FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}" +def filter(f, str, d): + from re import match + ret = [] + for w in str.split(): + if match(f, w, 0): + ret += [ w ] + return " ".join(ret) + +def filter_out(f, str, d): + from re import match + ret = [] + for w in str.split(): + if not match(f, w, 0): + ret += [ w ] + return " ".join(ret) + die() { oefatal "$*" }