summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcin Juszkiewicz <marcin@buglabs.net>2009-02-20 17:23:36 +0100
committerMarcin Juszkiewicz <marcin@buglabs.net>2009-02-20 17:23:36 +0100
commit7c1b438d4012ee43c5378b8b73a30e557aa60075 (patch)
treeec997f37adf6caa0df310ebcc74840282dc7cb53
parentd1e8a463a3dbbd7b9e2e60759e30a28264e90f42 (diff)
downloadpoky-7c1b438d4012ee43c5378b8b73a30e557aa60075.tar.gz
base.bbclass, bitbake.conf: add support for BP/BPN variables (backported from trunk)
commit 94c895aad5ad286f172b04bc33ba670220d5eba8 Author: Richard Purdie <rpurdie@linux.intel.com> 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
-rw-r--r--meta/classes/base.bbclass10
-rw-r--r--meta/conf/bitbake.conf9
2 files changed, 17 insertions, 2 deletions
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):
149 149
150DEPENDS_prepend="${@base_dep_prepend(d)} " 150DEPENDS_prepend="${@base_dep_prepend(d)} "
151 151
152def base_prune_suffix(var, suffixes, d):
153 # See if var ends with any of the suffixes listed and
154 # remove it if found
155 for suffix in suffixes:
156 if var.endswith(suffix):
157 return var.replace(suffix, "")
158 return var
159
152def base_set_filespath(path, d): 160def base_set_filespath(path, d):
153 import os, bb 161 import os, bb
154 filespath = [] 162 filespath = []
@@ -159,7 +167,7 @@ def base_set_filespath(path, d):
159 filespath.append(os.path.join(p, o)) 167 filespath.append(os.path.join(p, o))
160 return ":".join(filespath) 168 return ":".join(filespath)
161 169
162FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}" 170FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}"
163 171
164def oe_filter(f, str, d): 172def oe_filter(f, str, d):
165 from re import match 173 from re import match
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index c8f4b8dfe2..dc3352bf54 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -135,6 +135,13 @@ EXTENDPEVER = "${@['','${PE\x7d:'][bb.data.getVar('PE',d,1) > 0]}"
135DEBPV = "${EXTENDPEVER}${PV}-${PR}" 135DEBPV = "${EXTENDPEVER}${PV}-${PR}"
136P = "${PN}-${PV}" 136P = "${PN}-${PV}"
137 137
138# Base package name
139# Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
140# otherwise it is the same as PN and P
141SPECIAL_PKGSUFFIX = "-native -cross-sdk -cross -sdk -initial -intermediate"
142BPN = "${@base_prune_suffix(bb.data.getVar('PN', d, True), bb.data.getVar('SPECIAL_PKGSUFFIX', d, True).split(), d)}"
143BP = "${BPN}-${PV}"
144
138# Package info. 145# Package info.
139 146
140SECTION = "base" 147SECTION = "base"
@@ -217,7 +224,7 @@ STAMP = "${TMPDIR}/stamps/${PF}"
217WORKDIR = "${TMPDIR}/work/${PF}" 224WORKDIR = "${TMPDIR}/work/${PF}"
218T = "${WORKDIR}/temp" 225T = "${WORKDIR}/temp"
219D = "${WORKDIR}/image" 226D = "${WORKDIR}/image"
220S = "${WORKDIR}/${P}" 227S = "${WORKDIR}/${BP}"
221B = "${S}" 228B = "${S}"
222 229
223STAGING_DIR = "${TMPDIR}/staging" 230STAGING_DIR = "${TMPDIR}/staging"