Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] classes/insane: add check for PN in OVERRIDES
@ 2013-05-09 16:26 Paul Eggleton
  2013-05-09 16:37 ` Phil Blundell
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2013-05-09 16:26 UTC (permalink / raw)
  To: openembedded-core

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>
---
 meta/classes/insane.bbclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 809aa45..c19af84 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -904,6 +904,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':
-- 
1.8.1.2




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] classes/insane: add check for PN in OVERRIDES
  2013-05-09 16:26 [PATCH] classes/insane: add check for PN in OVERRIDES Paul Eggleton
@ 2013-05-09 16:37 ` Phil Blundell
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Blundell @ 2013-05-09 16:37 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core

On Thu, 2013-05-09 at 17:26 +0100, Paul Eggleton wrote:
> 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".

I think this patch is a fine one, but it makes me wonder whether we
should try to come up with a roadmap for changing the existing,
non-namespaced OVERRIDES into something less prone to namespace
collisions.  As a first step, we could just add namespaced equivalents
to the OVERRIDES in oe-core, i.e.:

MACHINEOVERRIDES ?= "${MACHINE}:machine-${MACHINE}"

etc, and then convert any usages of those within oe-core to use the new
style.  Then at some later date we can come up with a plan to remove the
old ones.

p.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-09 16:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-09 16:26 [PATCH] classes/insane: add check for PN in OVERRIDES Paul Eggleton
2013-05-09 16:37 ` Phil Blundell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox