public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] deb-src: do not error but warn for missing source packages
@ 2025-11-23  7:00 'Cedric Hombourger' via isar-users
  2025-11-26 10:03 ` Zhihang Wei
  0 siblings, 1 reply; 2+ messages in thread
From: 'Cedric Hombourger' via isar-users @ 2025-11-23  7:00 UTC (permalink / raw)
  To: isar-users; +Cc: 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.hombourger@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

-- 
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/20251123070029.1674527-1-cedric.hombourger%40siemens.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-26 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-23  7:00 [PATCH] deb-src: do not error but warn for missing source packages 'Cedric Hombourger' via isar-users
2025-11-26 10:03 ` Zhihang Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox