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
signature.asc
Description: signature