diff options
| author | Fawzi KHABER <fawzi.khaber@smile.fr> | 2023-03-29 10:57:56 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-03-30 12:32:30 +0100 |
| commit | b8486ffe807d08ae6f2c577295c249afc7aca3f1 (patch) | |
| tree | d8124e83649dbd4c5020d757614362d8ab487931 /meta/classes-global | |
| parent | 81740facf458a5a3326c0cfca20ebf75d8fe91d0 (diff) | |
| download | poky-b8486ffe807d08ae6f2c577295c249afc7aca3f1.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>
(From OE-Core rev: f6cb63d3a871c4eef52d981131a56bf41aa1dcdf)
Signed-off-by: Fawzi KHABER <fawzi.khaber@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global')
| -rw-r--r-- | meta/classes-global/package.bbclass | 9 |
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 () { | |||
| 496 | 496 | ||
| 497 | bb.build.exec_func("package_convert_pr_autoinc", d) | 497 | bb.build.exec_func("package_convert_pr_autoinc", d) |
| 498 | 498 | ||
| 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 | ||
| 501 | for p in packages: | ||
| 502 | localdata = bb.data.createCopy(d) | ||
| 503 | localdata.setVar('OVERRIDES', p) | ||
| 504 | rename = localdata.getVar('PKG') | ||
| 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 | |||
| 499 | ########################################################################### | 508 | ########################################################################### |
| 500 | # Optimisations | 509 | # Optimisations |
| 501 | ########################################################################### | 510 | ########################################################################### |
