]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/insane: add check for PN in OVERRIDES
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Thu, 9 May 2013 16:26:17 +0000 (17:26 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 10 May 2013 10:35:20 +0000 (11:35 +0100)
If a recipe is named such that its PN value matches something already in
OVERRIDES (such as when PN happens to be the same as MACHINE or DISTRO),
it can have unexpected consequences. Assignments such as
FILES_${PN} = "xyz" effectively turn into FILES = "xyz".

Implements [YOCTO #4288].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/insane.bbclass

index 4d2392e9084dcbd458baa3483c99456170b2e802..fb1802223a21374840e0fd65faa80536b8dffc27 100644 (file)
@@ -907,6 +907,11 @@ python () {
     if d.getVar('do_stage', True) is not None:
         bb.fatal("Legacy staging found for %s as it has a do_stage function. This will need conversion to a do_install or often simply removal to work with OE-core" % d.getVar("FILE", True))
 
+    overrides = d.getVar('OVERRIDES', True).split(':')
+    pn = d.getVar('PN', True)
+    if pn in overrides:
+        bb.warn('Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE", True), pn))
+
     issues = []
     if (d.getVar('PACKAGES', True) or "").split():
         for var in 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RCONFLICTS', 'RPROVIDES', 'RREPLACES', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm', 'ALLOW_EMPTY':