public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] Fix cache-deb-src functionality for non-amd64 builds
@ 2025-07-17 10:51 Anton Mikanovich
  0 siblings, 0 replies; only message in thread
From: Anton Mikanovich @ 2025-07-17 10:51 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Commit f0da749f introduced `apt-cache -o Dir=${rootfs} dumpavail`
method to get info about packages installed in rootfs, instead of
parsing dpkg.log previuosly used.

But it does not work in case of foreing architecture used. The list
comes empty and no source packages get downloaded.

Instead, chroot into the rootfs and run this inside. The difference:

Works for the same arch:
  apt-cache -o Dir=/build/tmp/work/debian-bookworm-amd64/isar-image-base-qemuamd64/1.0-r0/rootfs dumpavail | wc -l
  1190397

Doesn't work for the foreign arch:
  apt-cache -o Dir=/build/tmp/work/debian-bookworm-arm64/isar-image-base-qemuarm64/1.0-r0/rootfs/ dumpavail | wc -l
  0

After the patch:
  sudo chroot /build/tmp/work/debian-bookworm-arm64/isar-image-base-qemuarm64/1.0-r0/rootfs/ apt-cache dumpavail | wc -l
  1170789

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

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index 3f560da4..1f3876db 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -68,7 +68,9 @@ debsrc_download() {
     trap "rm -f ${avail} ${wanted}" EXIT
 
     # List all packages known to apt
-    apt-cache -o Dir=${rootfs} dumpavail | debsrc_source_version_filter > ${avail}
+    sudo -E chroot --userspec=$( id -u ):$( id -g ) ${rootfs} \
+        apt-cache dumpavail \
+        | debsrc_source_version_filter > ${avail}
 
     # Use apt-ftparchive to scan all .deb files found in the download directory
     # and get the <source> <version> pairs that we wish to download
-- 
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/20250717105159.1989307-1-amikan%40ilbers.de.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-17 10:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-17 10:51 [PATCH] Fix cache-deb-src functionality for non-amd64 builds Anton Mikanovich

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