summaryrefslogtreecommitdiffstats
path: root/meta/classes-global
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2023-10-03 19:44:54 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-06 11:51:11 +0100
commitef66352fccd6dcb43fc49730b2b6e51707bb706c (patch)
tree6c91f602f89d353496cd25a80ae39c6b2c8d1f47 /meta/classes-global
parent02b8c36efe26e7670288eacaa8b6bc1a91aa2d2d (diff)
downloadpoky-ef66352fccd6dcb43fc49730b2b6e51707bb706c.tar.gz
packages.bbclass: Correct the check for conflicts with renamed packages
The original solution replaced all overrides with the package name that was being checked. This can have unforseen consequences where some variable involved in defining the value for the PKG:<package> variable may rely on some override which is not set as expected. It also meant that any PKG variable set using an override would not be caught, e.g., PKG:${PN}:${MACHINE} = "${PN}-dev" (made up example that would always fail with the old code). (From OE-Core rev: de62d538dbfe6caf123ff366643f893077175583) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
-rw-r--r--meta/classes-global/package.bbclass8
1 files changed, 3 insertions, 5 deletions
diff --git a/meta/classes-global/package.bbclass b/meta/classes-global/package.bbclass
index 0338a5c690..7787042e21 100644
--- a/meta/classes-global/package.bbclass
+++ b/meta/classes-global/package.bbclass
@@ -508,11 +508,9 @@ python do_package () {
508 # Check for conflict between renamed packages and existing ones 508 # Check for conflict between renamed packages and existing ones
509 # for each package in PACKAGES, check if it will be renamed to an existing one 509 # for each package in PACKAGES, check if it will be renamed to an existing one
510 for p in packages: 510 for p in packages:
511 localdata = bb.data.createCopy(d) 511 rename = d.getVar('PKG:%s' % p)
512 localdata.setVar('OVERRIDES', p) 512 if rename and rename in packages:
513 rename = localdata.getVar('PKG') 513 bb.fatal('package "%s" is renamed to "%s" using PKG:%s, but package name already exists' % (p, rename, p))
514 if (rename != None) and rename in packages:
515 bb.fatal('package "%s" is renamed to "%s" using PKG:%s, but package name already exists'%(p,rename,p))
516 514
517 ########################################################################### 515 ###########################################################################
518 # Optimisations 516 # Optimisations