]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
packages.bbclass: Correct the check for conflicts with renamed packages
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>
Tue, 3 Oct 2023 17:44:54 +0000 (19:44 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Oct 2023 10:50:54 +0000 (11:50 +0100)
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).

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>
meta/classes-global/package.bbclass

index 0338a5c690bcd2a50f9d413b8dcea2b5fef666a8..7787042e2132a3608382a21db417cf23be3728c1 100644 (file)
@@ -508,11 +508,9 @@ python do_package () {
     # Check for conflict between renamed packages and existing ones
     # for each package in PACKAGES, check if it will be renamed to an existing one
     for p in packages:
-        localdata = bb.data.createCopy(d)
-        localdata.setVar('OVERRIDES', p)
-        rename = localdata.getVar('PKG')
-        if (rename != None) and rename in packages:
-            bb.fatal('package "%s" is renamed to "%s" using PKG:%s, but package name already exists'%(p,rename,p))
+        rename = d.getVar('PKG:%s' % p)
+        if rename and rename in packages:
+            bb.fatal('package "%s" is renamed to "%s" using PKG:%s, but package name already exists' % (p, rename, p))
 
     ###########################################################################
     # Optimisations