public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perl: Add option to prevent COMPLEMENTARY_GLOB from ignoring perl-modules
@ 2024-01-16 16:56 William.Lyu
  2024-01-16 16:56 ` [PATCH 2/2] openssl: Fix ptest dependencies on perl-module-* being ignored by COMPLEMENTARY_GLOB William.Lyu
  2024-01-16 17:24 ` [OE-core] [PATCH 1/2] perl: Add option to prevent COMPLEMENTARY_GLOB from ignoring perl-modules Alexander Kanavin
  0 siblings, 2 replies; 12+ messages in thread
From: William.Lyu @ 2024-01-16 16:56 UTC (permalink / raw)
  To: openembedded-core

From: William Lyu <William.Lyu@windriver.com>

When perl-modules is added via COMPLEMENTARY_GLOB, all perl-module-*
packages recommended by perl-modules are ignored due to the defined
behavior of COMPLEMENTARY_GLOB.

This patch creates a new package perl-modules-force-all that RDEPENDS on
the same set of packages perl-modules recommends. If another recipe
always needs the packages recommended by perl-modules, it can add
perl-modules-force-all to RDEPENDS to make sure that the recommended
packages by perl-modules are not ignored by COMPLEMENTARY_GLOB.

Signed-off-by: William Lyu <William.Lyu@windriver.com>
---
 meta/recipes-devtools/perl/perl_5.38.2.bb | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/meta/recipes-devtools/perl/perl_5.38.2.bb b/meta/recipes-devtools/perl/perl_5.38.2.bb
index a9d684cfc5..f75c5aa971 100644
--- a/meta/recipes-devtools/perl/perl_5.38.2.bb
+++ b/meta/recipes-devtools/perl/perl_5.38.2.bb
@@ -311,6 +311,14 @@ ALTERNATIVE_LINK_NAME[Thread.3] = "${mandir}/man3/Thread.3"
 ALLOW_EMPTY:${PN}-modules = "1"
 PACKAGES += "${PN}-modules "
 
+# When perl-modules is added through COMPLEMENTARY_GLOB, as it is recommending
+# packages, all its recommendations will be ignored. So, we create a
+# perl-modules-force-all package depending on the same set of packages as listed
+# in perl-modules to provide a way to guarantee COMPLEMENTARY_GLOB not removing
+# these packages.
+ALLOW_EMPTY:${PN}-modules-force-all = "1"
+PACKAGES += "${PN}-modules-force-all "
+
 PACKAGESPLITFUNCS =+ "split_perl_packages"
 
 python split_perl_packages () {
@@ -328,6 +336,20 @@ python split_perl_packages () {
     packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES').split())
     d.setVar(d.expand("RRECOMMENDS:${PN}-modules"), ' '.join(packages))
 
+    # perl-modules-force-all provides a way to prevent COMPLEMENTARY_GLOB
+    # from removing the packages specified in perl-modules.
+    # perl-modules-force-all contains the same set of packages as perl-modules.
+    d.setVar(
+        d.expand("RDEPENDS:${PN}-modules-force-all"),
+        d.getVar(d.expand("RRECOMMENDS:${PN}-modules"))
+    )
+
+    # As perl-modules-force-all depends on all other, potentially non-existent,
+    # perl packages, we allow these packages to be empty to prevent build
+    # errors.
+    for pkg in d.getVar(d.expand("RDEPENDS:${PN}-modules-force-all")).split():
+        d.setVar(d.expand("ALLOW_EMPTY:" + pkg), "1")
+
     # Read the pre-generated dependency file, and use it to set module dependecies
     for line in open(d.expand("${WORKDIR}") + '/perl-rdepends.txt').readlines():
         splitline = line.split()
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-01-22 10:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-16 16:56 [PATCH 1/2] perl: Add option to prevent COMPLEMENTARY_GLOB from ignoring perl-modules William.Lyu
2024-01-16 16:56 ` [PATCH 2/2] openssl: Fix ptest dependencies on perl-module-* being ignored by COMPLEMENTARY_GLOB William.Lyu
2024-01-16 17:20   ` [OE-core] " Alexander Kanavin
2024-01-16 18:56     ` Tim Orling
2024-01-17  4:52       ` ChenQi
2024-01-17 17:45         ` Lyu, William
     [not found]     ` <17AAE8D9425F667A.7072@lists.openembedded.org>
2024-01-16 22:31       ` [OE-core] " Tim Orling
2024-01-16 17:24 ` [OE-core] [PATCH 1/2] perl: Add option to prevent COMPLEMENTARY_GLOB from ignoring perl-modules Alexander Kanavin
2024-01-17 22:44   ` Lyu, William
2024-01-18  7:48     ` [OE-core] " Alexander Kanavin
2024-01-19 18:11       ` Lyu, William
2024-01-22 10:08         ` [OE-core] " Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox