public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH] deb-dl-dir: Fail if "apt-cache dumpavail" returns empty list
Date: Fri,  8 Aug 2025 12:45:20 +0300	[thread overview]
Message-ID: <20250808094520.3031199-1-amikan@ilbers.de> (raw)

For non-host architectures, "apt-cache dumpavail" returns empty output.
Because of this, "debsrc_download" function doesn't download any
source packages without an error.

Make the task fail on empty list so that it could be caught in CI.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/deb-dl-dir.bbclass | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index e75e6be5..4780be20 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -71,6 +71,12 @@ debsrc_download() {
     apt-cache -o APT::Architecture=${DISTRO_ARCH} -o Dir=${rootfs} dumpavail \
     | debsrc_source_version_filter > ${avail}
 
+    if [ $(cat ${avail} | wc -l) -eq 0 ]; then
+        bberror "No packages were found in apt cache"
+        debsrc_undo_mounts "${rootfs}"
+        return 1
+    fi
+
     # Use apt-ftparchive to scan all .deb files found in the download directory
     # and get the <source> <version> pairs that we wish to download
     apt-ftparchive --md5=no --sha1=no --sha256=no --sha512=no \
-- 
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 visit https://groups.google.com/d/msgid/isar-users/20250808094520.3031199-1-amikan%40ilbers.de.

             reply	other threads:[~2025-08-08  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08  9:45 Anton Mikanovich [this message]
2025-09-11  8:58 ` 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=20250808094520.3031199-1-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