All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [hardknott][PATCH 04/13] native.bbclass: Do not remove "-native" in the middle of recipe names
Date: Tue, 22 Jun 2021 17:50:23 +0800	[thread overview]
Message-ID: <a71d923d0f0e966b17e915a86b5ad7222a947122.1624352878.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1624352878.git.anuj.mittal@intel.com>

From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>

For dependencies such as "${PN}-foo", when modifying them for native
recipes, it is expected that they become "${BPN}-foo-native" rather
than "${BPN}-native-foo-native". This was previously done by removing
all occurences of "-native" from the dependency before adding
"-native" at the end. However, this fails for a recipe such as
"crate-native-tls" that happens to contain the string "-native" in the
middle of the name. Solve this by simply replacing ${PN} with ${BPN}
in the name instead before adding "-native" at the end

Also simplify adding "-native" to the end of names the recipe provides.
In this case it is not necessary to replace ${PN} with ${BPN} as the
recipes are expected to use ${BPN}-foo in the first place.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit edaf8ff278fc96b122c4fc3266b63856e3350f4c)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/classes/native.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
index a0838e41b9..561cc23f68 100644
--- a/meta/classes/native.bbclass
+++ b/meta/classes/native.bbclass
@@ -119,6 +119,7 @@ python native_virtclass_handler () {
     pn = e.data.getVar("PN")
     if not pn.endswith("-native"):
         return
+    bpn = e.data.getVar("BPN")
 
     # Set features here to prevent appends and distro features backfill
     # from modifying native distro features
@@ -146,7 +147,10 @@ python native_virtclass_handler () {
             elif "-cross-" in dep:
                 newdeps.append(dep.replace("-cross", "-native"))
             elif not dep.endswith("-native"):
-                newdeps.append(dep.replace("-native", "") + "-native")
+                # Replace ${PN} with ${BPN} in the dependency to make sure
+                # dependencies on, e.g., ${PN}-foo become ${BPN}-foo-native
+                # rather than ${BPN}-native-foo-native.
+                newdeps.append(dep.replace(pn, bpn) + "-native")
             else:
                 newdeps.append(dep)
         d.setVar(varname, " ".join(newdeps), parsing=True)
@@ -166,7 +170,7 @@ python native_virtclass_handler () {
         if prov.find(pn) != -1:
             nprovides.append(prov)
         elif not prov.endswith("-native"):
-            nprovides.append(prov.replace(prov, prov + "-native"))
+            nprovides.append(prov + "-native")
         else:
             nprovides.append(prov)
     e.data.setVar("PROVIDES", ' '.join(nprovides))
-- 
2.31.1


  parent reply	other threads:[~2021-06-22  9:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  9:50 [hardknott][PATCH 00/13] review request Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 01/13] curl: cleanup CVE patches for hardknott Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 02/13] libx11: fix CVE-2021-31535 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 03/13] util-linux.inc: Do not modify BPN Anuj Mittal
2021-06-22  9:50 ` Anuj Mittal [this message]
2021-06-22  9:50 ` [hardknott][PATCH 05/13] linux-yocto/5.4: update to v5.4.124 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 06/13] lttng-tools: upgrade 2.12.3 -> 2.12.4 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 07/13] linux-yocto/5.4: update to v5.4.125 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 08/13] linuxloader: Be aware of riscv32 ldso Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 09/13] valgrind: remove buggy ptest from arm64 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 10/13] valgrind: Actually install list of non-deterministic ptests Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 11/13] perf: Use python3targetconfig to ensure we use target libraries Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 12/13] avahi: apply fix for CVE-2021-3468 Anuj Mittal
2021-06-22  9:50 ` [hardknott][PATCH 13/13] kernel.bbclass: fix do_sizecheck() comparison Anuj Mittal
2021-06-26 14:29 ` [OE-core] [hardknott][PATCH 00/13] review request Richard Purdie

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=a71d923d0f0e966b17e915a86b5ad7222a947122.1624352878.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.