- Package:
- local-apt-repository
- Source:
- local-apt-repository
- Submitter:
- mike
- Date:
- 2025-07-21 23:43:01 UTC
- Severity:
- normal
- Tags:
Dear Maintainer,
If you have a bunch of packages, regeneration takes very long because it rebuilds everything from scratch. It should be using caching. Something like this:
apt-ftparchive packages --db cache.db ../../../$DEBS > $REPO/Packages
apt-ftparchive sources --db cache.db ../../../$DEBS > $REPO/Sources
I'm assuming you'll put it in /var/cache/local-apt-repository
Dear Maintainer, i encoutered more issues. Because i'm using mv, the files are relativelly old, so the if statement with the stamp isn't triggered. But with caching this can be removed. Then also force can be removed. And also the stamp. So now, i changed it to run greedely and rely on caching. in attachment what i'm using. the cache probably needs to be moved (/var/cache) and also i don't know if the cache will just grow uncontrollably. apt-ftparchive has a clean command, but it expects a config file. Maybe it's an oversite there.
Dear Maintainer, in the previous one, the loop doesn't do its job. fix
With the caching, it's also efficient to generate the Contents files
now:
diff --git a/rebuild b/rebuild
index 9afa60c..f0af00b 100755
--- a/rebuild
+++ b/rebuild
@@ -29,6 +29,10 @@ else
(cd $REPO
apt-ftparchive packages --db cache.db ../../../$DEBS > $REPO/Packages
apt-ftparchive sources --db cache.db ../../../$DEBS > $REPO/Sources
+ for arch in $(dpkg --print-architecture) $(dpkg --print-foreign-architectures)
+ do
+ apt-ftparchive contents --db cache.db ../../../$DEBS > $REPO/Contents-$arch
+ done
) && break || true
# ^ this can fail during a partial write to the directory (which
# would be detected by the loop), so ignore errors here
tags 1085265 + patch thanks I've taken these patches, added a few more, and created a merge request at: https://salsa.debian.org/debian/local-apt-repository/-/merge_requests/2 I've also attached the same series of patches to this message.
Ah, I forgot to handle the case where /srv/local-apt-repository doesn't exist when the package is installed. This updated patch (and my latest push on salsa.d.o) should fix that.