From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH 1/2] deb-dl-dir: Avoid multiple find run on export
Date: Fri, 12 Jul 2024 09:56:45 +0300 [thread overview]
Message-ID: <20240712065646.2156320-2-amikan@ilbers.de> (raw)
In-Reply-To: <20240712065646.2156320-1-amikan@ilbers.de>
We are running find on isar-apt repo for every new deb in cache.
This can be optimised by collecting isar-apt content once and compare
deb name with this list later.
It can be also usefull for the future isar-apt lock protection.
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta/classes/deb-dl-dir.bbclass | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index 8e0243fe..2d8739dc 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -89,6 +89,9 @@ deb_dl_dir_export() {
export rootfs="${1}"
export owner=$(id -u):$(id -g)
mkdir -p "${pc}"
+
+ isar_debs="\$(find '${REPO_ISAR_DIR}/${DISTRO}' -name '*.deb' -print)"
+
flock "${pc}".lock sudo -Es << 'EOSUDO'
set -e
printenv | grep -q BB_VERBOSE_LOGS && set -x
@@ -98,9 +101,8 @@ deb_dl_dir_export() {
while read p; do
# skip files from a previous export
[ -f "${pc}/${p##*/}" ] && continue
- # can not reuse bitbake function here, this is basically
- # "repo_contains_package"
- package=$(find "${REPO_ISAR_DIR}"/"${DISTRO}" -name ${p##*/})
+ # skip packages from isar-apt
+ package=$(echo "$isar_debs" | grep -F -m 1 "${p##*/}" | cat)
if [ -n "$package" ]; then
cmp --silent "$package" "$p" && continue
fi
--
2.34.1
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240712065646.2156320-2-amikan%40ilbers.de.
next prev parent reply other threads:[~2024-07-12 6:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 6:56 [PATCH 0/2] Protect isar-apt usages in shell Anton Mikanovich
2024-07-12 6:56 ` Anton Mikanovich [this message]
2024-07-12 6:56 ` [PATCH 2/2] meta: Cover bash isar-apt usages by isar.lock Anton Mikanovich
2024-07-23 7:38 ` [PATCH 0/2] Protect isar-apt usages in shell Uladzimir Bely
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=20240712065646.2156320-2-amikan@ilbers.de \
--to=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