summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2023-10-03 19:44:54 +0200
committerSteve Sakoman <steve@sakoman.com>2023-10-25 04:51:01 -1000
commit2b0c041e2cad5369f7ea2d5b97422958a2b6083d (patch)
tree48ee5149a9df505553f7f5baf423c0736887a09b
parent7c96ef81f8df657091b753f8079dbc389b79eaec (diff)
downloadpoky-2b0c041e2cad5369f7ea2d5b97422958a2b6083d.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: 3fc3e55933716ce9cfa8b2e8e4cc8fa2e94a0061) 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> (cherry picked from commit de62d538dbfe6caf123ff366643f893077175583) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-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 e8055a9cdc..08eb56dc3d 100644
--- a/meta/classes-global/package.bbclass
+++ b/meta/classes-global/package.bbclass
@@ -499,11 +499,9 @@ python do_package () {
499 # Check for conflict between renamed packages and existing ones 499 # Check for conflict between renamed packages and existing ones
500 # for each package in PACKAGES, check if it will be renamed to an existing one 500 # for each package in PACKAGES, check if it will be renamed to an existing one
501 for p in packages: 501 for p in packages:
502 localdata = bb.data.createCopy(d) 502 rename = d.getVar('PKG:%s' % p)
503 localdata.setVar('OVERRIDES', p) 503 if rename and rename in packages:
504 rename = localdata.getVar('PKG') 504 bb.fatal('package "%s" is renamed to "%s" using PKG:%s, but package name already exists' % (p, rename, p))
505 if (rename != None) and rename in packages:
506 bb.fatal('package "%s" is renamed to "%s" using PKG:%s, but package name already exists'%(p,rename,p))
507 505
508 ########################################################################### 506 ###########################################################################
509 # Optimisations 507 # Optimisations