From 7c1b438d4012ee43c5378b8b73a30e557aa60075 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Fri, 20 Feb 2009 17:23:36 +0100 Subject: base.bbclass, bitbake.conf: add support for BP/BPN variables (backported from trunk) commit 94c895aad5ad286f172b04bc33ba670220d5eba8 Author: Richard Purdie Date: Fri Jan 2 10:15:45 2009 +0000 bitbake.conf: Create BPN variable containing the pruned version of PN with various suffixes removed and use this for S and FILESPATH. This uses naming from OE but with improved code --- meta/classes/base.bbclass | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'meta/classes') diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 12a3f98f04..fd1308295e 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass @@ -149,6 +149,14 @@ def base_both_contain(variable1, variable2, checkvalue, d): DEPENDS_prepend="${@base_dep_prepend(d)} " +def base_prune_suffix(var, suffixes, d): + # See if var ends with any of the suffixes listed and + # remove it if found + for suffix in suffixes: + if var.endswith(suffix): + return var.replace(suffix, "") + return var + def base_set_filespath(path, d): import os, bb filespath = [] @@ -159,7 +167,7 @@ def base_set_filespath(path, d): filespath.append(os.path.join(p, o)) return ":".join(filespath) -FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}" +FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}" def oe_filter(f, str, d): from re import match -- cgit v1.2.3-54-g00ecf