summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFawzi KHABER <fawzi.khaber@smile.fr>2023-03-29 10:57:56 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-30 12:32:22 +0100
commitf6cb63d3a871c4eef52d981131a56bf41aa1dcdf (patch)
tree8767eeb190797314e29e426653464d38d7c27184
parent7d00f6ec578084a0a0e5caf36241d53036d996c4 (diff)
downloadopenembedded-core-contrib-f6cb63d3a871c4eef52d981131a56bf41aa1dcdf.tar.gz
package.bbclass: check packages name conflict in do_package
It is possible to rename packages with the macro PKG:${PN} and result in a package name conflict if the target name exists already. Add a fatal check to prevent this issue to go unnoticed. Fix [Yocto #12060] Reviewed-by: Yoann CONGAL <yoann.congal@smile.fr> Signed-off-by: Fawzi KHABER <fawzi.khaber@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-global/package.bbclass9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes-global/package.bbclass b/meta/classes-global/package.bbclass
index 8f01bc4323..e8055a9cdc 100644
--- a/meta/classes-global/package.bbclass
+++ b/meta/classes-global/package.bbclass
@@ -496,6 +496,15 @@ python do_package () {
bb.build.exec_func("package_convert_pr_autoinc", d)
+ # 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))
+
###########################################################################
# Optimisations
###########################################################################