From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH v2 1/2] base: Move SRC_APT extraction/filtering to dpkg-base class
Date: Mon, 6 Sep 2021 20:45:46 +0200 [thread overview]
Message-ID: <f5d8c6da1015e161368bf222f2fac983efda2b71.1630953946.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1630953946.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
apt:// SRC_URI entries only make sense for dpkg recipes. So move the
filtering over so that any attempt to use it for other types or recipes
is detected early and that related code is located in the same classes.s
Drop redundant expand=True from getVar at this chance. It's default.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/base.bbclass | 19 -------------------
meta/classes/dpkg-base.bbclass | 19 +++++++++++++++++++
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index b7de921..72d4cc0 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -138,25 +138,6 @@ def isar_export_proxies(d):
return bb.utils.export_proxies(d)
-# filter out all "apt://" URIs out of SRC_URI and stick them into SRC_APT
-python() {
- src_uri = (d.getVar('SRC_URI', True) or "").split()
- if len(src_uri) == 0:
- return
-
- prefix = "apt://"
- new_src_uri = []
- src_apt = []
- for u in src_uri:
- if u.startswith(prefix):
- src_apt.append(u[len(prefix) :])
- else:
- new_src_uri.append(u)
-
- d.setVar('SRC_URI', ' '.join(new_src_uri))
- d.prependVar('SRC_APT', ' '.join(src_apt))
-}
-
do_fetch[dirs] = "${DL_DIR}"
do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
do_fetch[vardeps] += "SRCREV"
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index d8c0995..dfa31ff 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -73,6 +73,25 @@ addtask patch after do_adjust_git before do_dpkg_build
SRC_APT ?= ""
+# filter out all "apt://" URIs out of SRC_URI and stick them into SRC_APT
+python() {
+ src_uri = (d.getVar('SRC_URI') or "").split()
+ if len(src_uri) == 0:
+ return
+
+ prefix = "apt://"
+ new_src_uri = []
+ src_apt = []
+ for u in src_uri:
+ if u.startswith(prefix):
+ src_apt.append(u[len(prefix) :])
+ else:
+ new_src_uri.append(u)
+
+ d.setVar('SRC_URI', ' '.join(new_src_uri))
+ d.prependVar('SRC_APT', ' '.join(src_apt))
+}
+
do_apt_fetch() {
if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then
return 0
--
2.31.1
next prev parent reply other threads:[~2021-09-06 18:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-06 18:45 [PATCH v2 0/2] Improve apt-fetch related tasks Jan Kiszka
2021-09-06 18:45 ` Jan Kiszka [this message]
2021-09-06 18:45 ` [PATCH v2 2/2] dpkg: Use noexec to disable unneeded apt tasks Jan Kiszka
2021-09-13 12:48 ` [PATCH v2 0/2] Improve apt-fetch related tasks Anton Mikanovich
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=f5d8c6da1015e161368bf222f2fac983efda2b71.1630953946.git.jan.kiszka@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=henning.schild@siemens.com \
--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