From: William.Lyu@windriver.com
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 1/2] perl: Add option to prevent COMPLEMENTARY_GLOB from ignoring perl-modules
Date: Tue, 16 Jan 2024 08:56:01 -0800 [thread overview]
Message-ID: <20240116165602.2053194-1-William.Lyu@windriver.com> (raw)
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
next reply other threads:[~2024-01-16 16:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 16:56 William.Lyu [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240116165602.2053194-1-William.Lyu@windriver.com \
--to=william.lyu@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox