[PATCH] deb-src: do not error but warn for missing source packages

5 views
Skip to first unread message

Cedric Hombourger

unread,
Nov 23, 2025, 2:00:38 AMNov 23
to isar-...@googlegroups.com, Cedric Hombourger
Some package repositories may only provide binary packages and no
source packages. While this is unfortunate, it shouldn't be fatal
either. Collect names and versions and print a warning for each.

Signed-off-by: Cedric Hombourger <cedric.h...@siemens.com>
---
meta/classes/deb-dl-dir.bbclass | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index 16ccd426..7ebc3526 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -41,7 +41,8 @@ debsrc_download() {
# since "set -e" is used)
avail=$(mktemp)
wanted=$(mktemp)
- trap "rm -f ${avail} ${wanted}" EXIT
+ missing=$(mktemp)
+ trap "rm -f ${avail} ${wanted} ${missing}" EXIT

# List all packages known to apt
apt-cache -o APT::Architecture=${DISTRO_ARCH} -o Dir=${rootfs} dumpavail \
@@ -80,9 +81,16 @@ debsrc_download() {
-- \
apt-get -o APT::Architecture=${DISTRO_ARCH} \
-o Dir="${rootfs}" -y --download-only \
- --only-source source "${src}=${version}"
+ --only-source source "${src}=${version}" \
+ || echo "${src} ${version}" >> ${missing}
}
done
+
+ # warn for missing source packages
+ sort -u -o ${missing} ${missing}
+ while read pkg ver; do
+ bbwarn "could not find or download sources for ${pkg} ${ver}"
+ done < ${missing}
) 9>"${DEBSRCDIR}/${rootfs_distro}.lock"
}

--
2.47.3

Zhihang Wei

unread,
Nov 26, 2025, 5:03:25 AMNov 26
to Cedric Hombourger, isar-...@googlegroups.com
Applied to next, thanks.
Reply all
Reply to author
Forward
0 new messages