Patchwork [RFC,2/2] packagedata: Show error when trying to change PE/PV/PR from runtime/pkgdata

login
register
mail settings
Submitter Martin Jansa
Date April 3, 2013, 10:14 a.m.
Message ID <1364984074-3636-2-git-send-email-Martin.Jansa@gmail.com>
Download mbox | patch
Permalink /patch/47329/
State Accepted, archived
Headers show

Comments

Martin Jansa - April 3, 2013, 10:14 a.m.
* causes build failure before do_package_write_ipk fails when trying to use wrong WORKDIR
---
 meta/classes/packagedata.bbclass | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Patch

diff --git a/meta/classes/packagedata.bbclass b/meta/classes/packagedata.bbclass
index 120cd64..b22458e 100644
--- a/meta/classes/packagedata.bbclass
+++ b/meta/classes/packagedata.bbclass
@@ -1,7 +1,10 @@ 
 python read_subpackage_metadata () {
     import oe.packagedata
 
+    pe = d.getVar('PE', True)
     pn = d.getVar('PN', True)
+    pr = d.getVar('PR', True)
+    pv = d.getVar('PV', True)
     data = oe.packagedata.read_pkgdata(pn, d)
 
     for key in data.keys():
@@ -14,5 +17,17 @@  python read_subpackage_metadata () {
                 if sdata[key] != pn:
                     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]))
                 continue
+            if key == "PE":
+                if sdata[key] != pe:
+                    bb.fatal("Recipe %s is trying to change PE from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pe, sdata[key]))
+                continue
+            if key == "PV":
+                if sdata[key] != pv:
+                    bb.fatal("Recipe %s is trying to change PV from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pv, sdata[key]))
+                continue
+            if key == "PR":
+                if sdata[key] != pr:
+                    bb.fatal("Recipe %s is trying to change PR from '%s' to '%s'. This will cause do_package_write_ipk failing to find right workdir." % (pn, pr, sdata[key]))
+                continue
             d.setVar(key, sdata[key])
 }