diff options
| author | Marcin Juszkiewicz <marcin@buglabs.net> | 2009-02-20 17:23:36 +0100 |
|---|---|---|
| committer | Marcin Juszkiewicz <marcin@buglabs.net> | 2009-02-20 17:33:13 +0100 |
| commit | f29120d571efe2cd0f9afa5dbace44ab2e8a7e5d (patch) | |
| tree | c6bee86474627b4943ff4bd21942be008cfdc8e1 | |
| parent | b5a58d32f0c1195410693664a77837cdb77eac1c (diff) | |
| download | poky-f29120d571efe2cd0f9afa5dbace44ab2e8a7e5d.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.bbclass | 10 | ||||
| -rw-r--r-- | meta/conf/bitbake.conf | 9 |
2 files changed, 17 insertions, 2 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index 3b10c985e5..07ebfe67d9 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
| @@ -167,6 +167,14 @@ def base_both_contain(variable1, variable2, checkvalue, d): | |||
| 167 | 167 | ||
| 168 | DEPENDS_prepend="${@base_dep_prepend(d)} " | 168 | DEPENDS_prepend="${@base_dep_prepend(d)} " |
| 169 | 169 | ||
| 170 | def base_prune_suffix(var, suffixes, d): | ||
| 171 | # See if var ends with any of the suffixes listed and | ||
| 172 | # remove it if found | ||
| 173 | for suffix in suffixes: | ||
| 174 | if var.endswith(suffix): | ||
| 175 | return var.replace(suffix, "") | ||
| 176 | return var | ||
| 177 | |||
| 170 | def base_set_filespath(path, d): | 178 | def base_set_filespath(path, d): |
| 171 | import os, bb | 179 | import os, bb |
| 172 | filespath = [] | 180 | filespath = [] |
| @@ -177,7 +185,7 @@ def base_set_filespath(path, d): | |||
| 177 | filespath.append(os.path.join(p, o)) | 185 | filespath.append(os.path.join(p, o)) |
| 178 | return ":".join(filespath) | 186 | return ":".join(filespath) |
| 179 | 187 | ||
| 180 | FILESPATH = "${@base_set_filespath([ "${FILE_DIRNAME}/${PF}", "${FILE_DIRNAME}/${P}", "${FILE_DIRNAME}/${PN}", "${FILE_DIRNAME}/files", "${FILE_DIRNAME}" ], d)}" | 188 | 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)}" |
| 181 | 189 | ||
| 182 | def oe_filter(f, str, d): | 190 | def oe_filter(f, str, d): |
| 183 | from re import match | 191 | from re import match |
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 755efb8745..310d68c618 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
| @@ -144,6 +144,13 @@ EXTENDPEVER = "${@['','${PE\x7d:'][bb.data.getVar('PE',d,1) > 0]}" | |||
| 144 | DEBPV = "${EXTENDPEVER}${PV}-${PR}" | 144 | DEBPV = "${EXTENDPEVER}${PV}-${PR}" |
| 145 | P = "${PN}-${PV}" | 145 | P = "${PN}-${PV}" |
| 146 | 146 | ||
| 147 | # Base package name | ||
| 148 | # Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial" | ||
| 149 | # otherwise it is the same as PN and P | ||
| 150 | SPECIAL_PKGSUFFIX = "-native -cross-sdk -cross -sdk -initial -intermediate" | ||
| 151 | BPN = "${@base_prune_suffix(bb.data.getVar('PN', d, True), bb.data.getVar('SPECIAL_PKGSUFFIX', d, True).split(), d)}" | ||
| 152 | BP = "${BPN}-${PV}" | ||
| 153 | |||
| 147 | # Package info. | 154 | # Package info. |
| 148 | 155 | ||
| 149 | SECTION = "base" | 156 | SECTION = "base" |
| @@ -232,7 +239,7 @@ STAMP = "${TMPDIR}/stamps/${MULTIMACH_TARGET_SYS}/${PF}" | |||
| 232 | WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PF}" | 239 | WORKDIR = "${TMPDIR}/work/${MULTIMACH_TARGET_SYS}/${PF}" |
| 233 | T = "${WORKDIR}/temp" | 240 | T = "${WORKDIR}/temp" |
| 234 | D = "${WORKDIR}/image" | 241 | D = "${WORKDIR}/image" |
| 235 | S = "${WORKDIR}/${P}" | 242 | S = "${WORKDIR}/${BP}" |
| 236 | B = "${S}" | 243 | B = "${S}" |
| 237 | 244 | ||
| 238 | STAGING_DIR = "${TMPDIR}/staging" | 245 | STAGING_DIR = "${TMPDIR}/staging" |
