Package: sbuild Version: 0.71.0-2 Severity: normal File: /usr/sbin/sbuild-createchroot Tags: patch
Steps to reproduce: sudo sbuild-createchroot --make-sbuild-tarball=sid.tgz sid sid http://192.168.122.1:3142/debian Expected result: sid.tgz contains only package contents and apt lists Actual result: sid.tgz also contains /var/cache/apt/archives/*.deb, which are unnecessary and waste space (current sid amd64 is 211M with these archives or 121M without). -- System Information: Debian Release: stretch/sid APT prefers unstable-debug APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental-debug'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages sbuild depends on: ii adduser 3.115 ii apt-utils 1.3.1 ii libsbuild-perl 0.71.0-2 pn perl:any <none> Versions of packages sbuild recommends: ii debootstrap 1.0.84 Versions of packages sbuild suggests: ii autopkgtest 4.1 pn deborphan <none> ii wget 1.18-4 -- no debconf information
>From b846e8549c911e625e5c91197cfaa1aebdc6be49 Mon Sep 17 00:00:00 2001 From: Simon McVittie <s...@debian.org> Date: Tue, 18 Oct 2016 09:36:32 +0100 Subject: [PATCH] sbuild-createchroot: clean up downloaded .deb archives This makes the tarball significantly smaller (121M vs. 211M for current unstable on amd64), and the downloaded archives don't seem to be useful for anything. Signed-off-by: Simon McVittie <s...@debian.org> --- bin/sbuild-createchroot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/sbuild-createchroot b/bin/sbuild-createchroot index 06977c9..ce8005e 100755 --- a/bin/sbuild-createchroot +++ b/bin/sbuild-createchroot @@ -462,6 +462,10 @@ if ($conf->get('ARCH') eq $conf->get('HOST_ARCH')) { print "W: Failed to upgrade chroot\n" if ($status); + $status = $resolver->clean(); + print "W: Failed to clean up downloaded packages\n" + if ($status); + $resolver->cleanup(); $session->end_session(); $session = undef; -- 2.9.3