On Mon, 09 Nov 2015 14:27:16 +0100 Joachim Breitner <nome...@debian.org> wrote: > Package: local-apt-repository > Version: 0.3 > Severity: wishlist > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi myself, > > Felipe Sateler writes in > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=796549#43 > how to use ftp-aptarchive here, which is supposedly better. I should > look into this the next time I work on the code.
Attaching full patch here for completeness. Saludos
From d3d993e3fc23510ceddc352ae1ee15f0b7ca8cf4 Mon Sep 17 00:00:00 2001 From: Felipe Sateler <fsate...@debian.org> Date: Mon, 9 Nov 2015 10:37:02 -0300 Subject: [PATCH] Use apt-ftparchive from apt-utils The generated Release file was not valid. Use apt-ftparchive to offload the responsibility to apt itself. Since we are now using apt-ftparchive, also use it to generate both Packages and Sources. Drop dependency on dpkg-dev as we no longer use anything from there. Closes: #804542 --- debian/control | 2 +- rebuild | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/debian/control b/debian/control index 4234139..d82e98e 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,7 @@ Package: local-apt-repository Architecture: all Depends: systemd, - dpkg-dev, + apt-utils, ${misc:Depends}, Description: Ready to use local apt repository With this package installed, every Debian package (i.e. a *.deb file) dropped diff --git a/rebuild b/rebuild index 9878c47..966a417 100755 --- a/rebuild +++ b/rebuild @@ -39,8 +39,8 @@ else # Relative paths work better than absolute (cd $REPO - dpkg-scanpackages -m ../../../$DEBS > $REPO/Packages - dpkg-scansources ../../../$DEBS > $REPO/Sources + apt-ftparchive packages ../../../$DEBS > $REPO/Packages + apt-ftparchive sources ../../../$DEBS > $REPO/Sources ) || true # ^ this can fail during a partial write to the directory (which # would be detected by the loop), so ignore errors here @@ -51,12 +51,8 @@ else fi -cat > $REPO/Release <<__END__ -Description: Local repository created by local-apt-repository -Origin: local-apt-repository -Components: . -MD5Sum: - $(md5sum $REPO/Packages|cut -d\ -f1) $(wc -c $REPO/Packages|cut -d\ -f1) Packages - $(md5sum $REPO/Sources|cut -d\ -f1) $(wc -c $REPO/Sources|cut -d\ -f1) Sources -__END__ +apt-ftparchive \ + -o "APT::FTPArchive::Release::Origin=local-apt-repository" \ + -o "APT::FTPArchive::Release::Description=Local repository created by local-apt-repository" \ + release $REPO > $REPO/Release -- 2.6.2