Package: libsbuild-perl
Version: 0.78.1-2
Severity: normal
X-Debbugs-Cc: vagr...@debian.org

Dear Maintainer,

Forenote: I'm Cc'ing vagr...@debian.org because he reported a related issue to 
this one
and the fix for this issue might impact him.


I'm using a slow internet connection and, when repeatedly testing
a package I've modified with sbuild, it takes a long time downloading
packages for dependencies of the built package.

So I've made the /var/cache/apt/archive directory persistent in the schroot
by binding it to a directory on the host.
So downloaded packages by apt are kept even after the schroot session is ended.

But, even if I disable "$apt_clean" option, sbuild always download dependencies
packages at each invocation.

I've found in "/usr/share/perl5/Sbuild/ResolverBase.pm", that sbuild is using
APT::Keep-Downloaded-Packages "false"

This makes all downloaded packages by apt deleted after installation.
As this apt option is used unconditionally, sbuild always download, install
dependencies for the built package and then delete the downloaded packages
from the cache at each invocation.


APT::Keep-Downloaded-Packages option was introduced to fix this bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861762


I suggest to set `APT::Keep-Downloaded-Packages` to "false" only if the option
"$apt_clean" option is set to 1, else set it to "true".

The current description of the apt_clean option is:
  APT clean.  1 to enable running "apt-get clean" at the start of each
  build, or 0 to disable.

If accepted, I suggest to amend this description accordingly.

I can provide a patch if this solution is accepted.

What do you think about that solution ?


Related commit: 
https://salsa.debian.org/debian/sbuild/commit/1159497b26aabbb3380ac3475c11aff556ca1de2


-- System Information:
Debian Release: 10.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-5-amd64 (SMP w/2 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8),
LANGUAGE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libsbuild-perl depends on:
ii  apt                      1.8.1
ii  dpkg-dev                 1.19.6
ii  gnupg                    2.2.13-2
ii  libdpkg-perl             1.19.6
ii  libexception-class-perl  1.44-1
ii  libfilesys-df-perl       0.92-6+b4
ii  libmime-lite-perl        3.030-2
ii  perl                     5.28.1-6

Versions of packages libsbuild-perl recommends:
ii  autopkgtest  5.10
ii  schroot      1.6.10-6+b1

Versions of packages libsbuild-perl suggests:
pn  default-mta | mail-transport-agent  <none>
ii  libwww-perl                         6.36-2

-- no debconf information

-- 
Alexis Murzeau
PGP: B7E6 0EBB 9293 7B06 BDBC  2787 E7BD 1904 F480 937F

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to