public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: isar-users <isar-users@googlegroups.com>
Cc: Anton Mikanovich <amikan@ilbers.de>,
	"Schmidt, Adriaan" <adriaan.schmidt@siemens.com>
Subject: [PATCH] multiarch: Fix PN-to-BPN massaging
Date: Sat, 30 Mar 2024 15:25:37 +0100	[thread overview]
Message-ID: <426c29dc-ab8d-45e8-83e8-70ddcb91efce@web.de> (raw)

From: Jan Kiszka <jan.kiszka@siemens.com>

SRC_URI and FILESPATH are differently built, thus can't be handled the
same way when trying to translate PN to BPN. While entries in the former
are space-separated, they are colon-separated in the latter.

Furthermore, the existing logic didn't properly split the entries, rather
processed the complete string. That was surely not desired as well.

Account for all by handling the variables separately and by splitting
them first. This fixes warnings like

WARNING: /build/../repo/meta-isar/recipes-core/images/isar-image-installer.bb: Unable to get checksum for isar-image-installer-native SRC_URI entry debian-configscript.sh: file could not be found

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/multiarch.bbclass | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass
index 5783b0bf..3123045e 100644
--- a/meta/classes/multiarch.bbclass
+++ b/meta/classes/multiarch.bbclass
@@ -46,12 +46,16 @@ python multiarch_virtclass_handler() {
     # parse time, and parsing always happens for all build variants. So in those
     # few variables, we automatically replace ${PN} with ${BPN}.
     def fixup_pn_in_vars(d):
-        vars = 'SRC_URI FILESPATH'.split()
-        for var in vars:
-            v = d.getVar(var, expand=False)
-            if v is not None and '${PN}' in v:
-                d.setVar(var + ':remove', v)
-                d.appendVar(var, ' ' + v.replace('${PN}', '${BPN}'))
+        v = d.getVar('SRC_URI', expand=False) or ''
+        for uri in v.split(':'):
+            if '${PN}' in uri:
+                d.setVar('SRC_URI' + ':remove', uri)
+                d.appendVar('SRC_URI', ' ' + uri.replace('${PN}', '${BPN}'))
+
+        v = d.getVar('FILESPATH', expand=False) or ''
+        for path in v.split(':'):
+            if '${PN}' in path:
+                d.appendVar('FILESPATH', ':' + path.replace('${PN}', '${BPN}'))

     # When building compat/native, the corresponding suffix needs to be
     # propagated to all bitbake dependency definitions.
--
2.35.3


             reply	other threads:[~2024-03-30 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-30 14:25 Jan Kiszka [this message]
2024-04-01 12:42 ` Uladzimir Bely
2024-04-01 13:13   ` Jan Kiszka

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=426c29dc-ab8d-45e8-83e8-70ddcb91efce@web.de \
    --to=jan.kiszka@web.de \
    --cc=adriaan.schmidt@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /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