lb source: fetch source packages once

Iterate over source package names and call `apt-get source $srcpkg`, instead of
looping over binary package names and calling `apt-get source $binpkg`.

Taking libreoffice as an example, this means calling `apt-get source
libreoffice` once instead of hundreds of times.

Specify --only-source in `apt-get source` to make explicit the fact that the
argument is a source package name. This is necessary to make ambiguous cases
work, such as `libftdi1` which is both a source package name and a binary
package provided by a different source, `libftdi`.

The checksums in source/{live,debian}/sha256sum.txt are identical with and
without this patch.
This commit is contained in:
Emanuele Rocca 2024-09-02 11:12:33 +02:00
parent 7f28a6dea5
commit ccf1f49bb9
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ fi
cat >> chroot/source-selection.sh << EOF
#!/bin/sh
dpkg-query -W -f='\${binary:Package}=\${Version}\n' > source-selection.txt
dpkg-query -W -f='\${source:Package}=\${source:Version}\n' | sort -u > source-selection.txt
EOF
Chroot chroot "sh source-selection.sh"
@ -118,7 +118,7 @@ cat > chroot/source-download.sh << EOF
#!/bin/sh
cd source.pkgs
PACKAGE="\${1}"
if ! apt-get ${APT_OPTIONS} --download-only source \${PACKAGE}
if ! apt-get ${APT_OPTIONS} --only-source --download-only source \${PACKAGE}
then
dpkg -l \${PACKAGE} | tail -n1 >> ../missing-source.txt
touch ../missing-source-some