Hi,
Quoting Uladzimir Bely (2021-10-28 10:58:26)
When building a package with sbuild, some packages (dependencies of package being built) are internally downloaded and installed by apt. After the build finished, schroot is cleaned again (while everything is done in overlay)
I need to cache outside of schroot these .deb files that were downloaded by apt. They are supposed to be used for creaing a local partial debian repository, so that the second build will use this local repo instead of internet one.
Currently it's done by parsing dependencies and downloading them independently, but I suppose there should be some more straightforward way to
get them using sbuild.
I investigated and tried several options for sbuild (like --purge-build=never,
--purge-deps=never, --purge-session=never), tried to find .deb files during the build using at some stages (--pre-build-commands="ls -la /var/cache/apt/ archives/", --starting-build-commands="ls -la /var/cache/apt/archives/", -- finished-build-commands="ls -la /var/cache/apt/archives/") - but I couldn't see any .deb files inside the schroot.
I previously asked in debian-user maillist (https://lists.debian.org/debian-user/2021/10/msg01044.html), but the tips I got (like using caching proxy) are
not what I really need. While sbuild already does the thing (downloading/ installing dependencies), I suppose there should be a way to (at least) see the *.deb files downloaded in '/var/cache/apt/archives' inside schroot.
sbuild maintainer here. You have not explained why you don't want to use a caching proxy like apt-cacher-ng. But using a caching proxy is also what I would suggest you use.
If you don't want to use that, here is how you download only the packages you need to satisfy the build depenencies of a particular source package:
cat << END > /tmp/apt.conf
Apt::Architecture "amd64";
Dir "/tmp/apt";
Dir::Etc::trusted "/etc/apt/trusted.gpg";
Dir::Etc::trustedparts "/etc/apt/trusted.gpg.d/";
Apt::Get::Download-Only true;
Apt::Install-Recommends false;
END
mkdir -p /tmp/apt/etc/apt/apt.conf.d/ /tmp/apt/etc/apt/sources.list.d/ /tmp/apt/var/lib/dpkg /tmp/apt/var/cache/apt/archives/partial /tmp/apt/etc/apt/preferences.d/
touch /tmp/apt/var/lib/dpkg/status
cat << END > /tmp/apt/etc/apt/sources.list
deb
http://deb.debian.org/debian/ unstable main
deb-src
http://deb.debian.org/debian/ unstable main
END
APT_CONFIG=/tmp/apt.conf apt update
APT_CONFIG=/tmp/apt.conf apt-get dist-upgrade
APT_CONFIG=/tmp/apt.conf apt-get build-dep hello
Now all your packages to build src:hello are in /tmp/apt/var/cache/apt/archives. No need to waste CPU cycles on a full package build if all you want is to download a certain set of binary packages.
Thanks!
cheers, josch
--==============%41129245661378181=MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Description: signature
Content-Type: application/pgp-signature; name="signature.asc"; charset="us-ascii"
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEElFhU6KL81LF4wVq58sulx4+9g+EFAmF6j2gACgkQ8sulx4+9 g+HhbA//dtw8+WxuyZAwjXQZUOs1Bar0FAjr4QlTDcifhMvupEPH9TNo65RoD726 qJecbnpO5a9Qj+CxVrQLzTs+EO+iZNA1XnICT2XgP4DRJaWdHT8aVmt2KK7kUzkZ P9li7+Lv+L74H30BlnUs3zs3UZ71XvRoaTh+p9rE3QWXt60/Z53WyR3Eh/WjcPFk vC/dLabgRsXM4TMQs8m3VTxUbcQKlBOsLGjp9ijoB0V6jS+xa6PeWBTy3RS0MBOe pU6ao4QtmiaFVnZr4wwzZro0xgFX8h+n/Jdu1vXpB4tWZZs3HvTkrtrrt0vERdRC cPgFHDeh5XFm5kbFUxz5vvuDVAtrCnc8aL7pxmgE76GpA8aE77QYa64Oos1R/u2c ibT8yjch4W6KpNFDN3htqOedvKCksVkWos/93thKOv0jZe6+fAevz86HfGxDMdDF N/jBPHK2NPKn7YJZd2CH5zCiZUJ8nIIx0jhN8UghFo0oRyeNtLLTRKUzVcS+oNN3 pEdE7Yk046Qb98UEPWaBnE4rCoRAtNiAP9WrDgQfhz+TnyHLJDb5c1qQpIEAMZ1K DJePKSM4qwW/0XrOrMAfRfd3Frczrl5ooRC/cC27AVqjRQmRHleT3+GBJ8OH3H8y JwNI6c202CvhuZBLi+FGkPqLkFVYZ2B8ijrm9n31TaGPfrAbh7k=
=6AV8
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)