From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH v2 2/2] dpkg: Use noexec to disable unneeded apt tasks
Date: Mon, 6 Sep 2021 20:45:47 +0200 [thread overview]
Message-ID: <1d95a4e3af2dc29aff8a746d89b5729e42366ff8.1630953946.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1630953946.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
This avoids needless waiting for isar.lock in do_apt_fetch.
Unfortunately, using an even simpler inline python function for setting
task[noexec] does not work, even when setting expand to false for
SRC_APT. So move this to the anonymous python function as well.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/dpkg-base.bbclass | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index dfa31ff..83500da 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -76,8 +76,6 @@ 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 = []
@@ -90,12 +88,14 @@ python() {
d.setVar('SRC_URI', ' '.join(new_src_uri))
d.prependVar('SRC_APT', ' '.join(src_apt))
+
+ if d.getVar('SRC_APT').strip() == '':
+ d.setVarFlag('do_apt_fetch', 'noexec', '1')
+ d.setVarFlag('do_apt_unpack', 'noexec', '1')
+ d.setVarFlag('do_cleanall_apt', 'noexec', '1')
}
do_apt_fetch() {
- if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then
- return 0
- fi
dpkg_do_mounts
E="${@ isar_export_proxies(d)}"
sudo -E chroot ${BUILDCHROOT_DIR} /usr/bin/apt-get update \
@@ -118,9 +118,6 @@ do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
do_apt_fetch[depends] = "${BUILDCHROOT_DEP}"
do_apt_unpack() {
- if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then
- return 0
- fi
rm -rf ${S}
dpkg_do_mounts
E="${@ isar_export_proxies(d)}"
@@ -144,9 +141,6 @@ addtask apt_unpack after do_apt_fetch before do_patch
addtask cleanall_apt before do_cleanall
do_cleanall_apt[nostamp] = "1"
do_cleanall_apt() {
- if [ -z "${@d.getVar("SRC_APT", True).strip()}" ]; then
- return 0
- fi
for uri in "${SRC_APT}"; do
rm -rf "${DEBSRCDIR}"/"${DISTRO}"/"$uri"
done
--
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 ` [PATCH v2 1/2] base: Move SRC_APT extraction/filtering to dpkg-base class Jan Kiszka
2021-09-06 18:45 ` Jan Kiszka [this message]
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=1d95a4e3af2dc29aff8a746d89b5729e42366ff8.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