[PATCH] deb-dl-dir: Fail if "apt-cache dumpavail" returns empty list

4 views
Skip to first unread message

Anton Mikanovich

unread,
Aug 8, 2025, 5:45:31 AMAug 8
to isar-...@googlegroups.com, Anton Mikanovich
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 <ami...@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

Anton Mikanovich

unread,
Sep 11, 2025, 4:58:52 AM (2 days ago) Sep 11
to isar-...@googlegroups.com
08/08/2025 12:45, Anton Mikanovich wrote:
> 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 <ami...@ilbers.de>
Applied to next.
Reply all
Reply to author
Forward
0 new messages