diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-28 08:30:59 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-28 10:01:28 +0100 |
commit | d3ce916c7c2490154f0e749a4466f4df6307acde (patch) | |
tree | 2234e47e7f554117ac954736ab84e8250754d471 /meta/classes/packagedata.bbclass | |
parent | 1cc028840dda6b471e79ab4a701543e313977c53 (diff) | |
download | poky-d3ce916c7c2490154f0e749a4466f4df6307acde.tar.gz |
packagedata: Show error when trying to change PE/PV/PR from runtime/pkgdata
PN/PE/PV/PR should never change between do_package and the following do_package_write_*
tasks. If any do change you would see build failure due to the wrong WORKDIR being
used for example.
This patch ensures that if something is going wrong we see the error earlier and
with some better warning about what the real problem is.
[YOCTO #4102 partial]
This is a rewritten version of a patch from Martin Jansa <martin.jansa@gmail.com>
(From OE-Core rev: f5252fea11e13dbcec1c277cf1bf0d7e61b60690)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/packagedata.bbclass')
-rw-r--r-- | meta/classes/packagedata.bbclass | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/meta/classes/packagedata.bbclass b/meta/classes/packagedata.bbclass index 120cd6445f..d1aedf2289 100644 --- a/meta/classes/packagedata.bbclass +++ b/meta/classes/packagedata.bbclass | |||
@@ -1,8 +1,14 @@ | |||
1 | python read_subpackage_metadata () { | 1 | python read_subpackage_metadata () { |
2 | import oe.packagedata | 2 | import oe.packagedata |
3 | 3 | ||
4 | pn = d.getVar('PN', True) | 4 | vars = { |
5 | data = oe.packagedata.read_pkgdata(pn, d) | 5 | "PN" : d.getVar('PN', True), |
6 | "PE" : d.getVar('PE', True), | ||
7 | "PV" : d.getVar('PV', True), | ||
8 | "PR" : d.getVar('PR', True), | ||
9 | } | ||
10 | |||
11 | data = oe.packagedata.read_pkgdata(vars["PN"], d) | ||
6 | 12 | ||
7 | for key in data.keys(): | 13 | for key in data.keys(): |
8 | d.setVar(key, data[key]) | 14 | d.setVar(key, data[key]) |
@@ -10,9 +16,11 @@ python read_subpackage_metadata () { | |||
10 | for pkg in d.getVar('PACKAGES', True).split(): | 16 | for pkg in d.getVar('PACKAGES', True).split(): |
11 | sdata = oe.packagedata.read_subpkgdata(pkg, d) | 17 | sdata = oe.packagedata.read_subpkgdata(pkg, d) |
12 | for key in sdata.keys(): | 18 | for key in sdata.keys(): |
13 | if key == "PN": | 19 | if key in vars: |
14 | if sdata[key] != pn: | 20 | if sdata[key] != vars[key]: |
15 | bb.fatal("Recipe %s is trying to create package %s which was already written by recipe %s. This will cause corruption, please resolve this and only provide the package from one recipe or the other or only build one of the recipes." % (pn, pkg, sdata[key])) | 21 | if key == "PN": |
22 | bb.fatal("Recipe %s is trying to create package %s which was already written by recipe %s. This will cause corruption, please resolve this and only provide the package from one recipe or the other or only build one of the recipes." % (vars[key], pkg, sdata[key])) | ||
23 | bb.fatal("Recipe %s is trying to change %s from '%s' to '%s'. This will cause do_package_write_* failures since the incorrect data will be used and they will be unable to find the right workdir." % (vars["PN"], key, vars[key], sdata[key])) | ||
16 | continue | 24 | continue |
17 | d.setVar(key, sdata[key]) | 25 | d.setVar(key, sdata[key]) |
18 | } | 26 | } |