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