summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2014-09-10 11:22:14 +0200
committerHelmut Grohne <helmut@subdivi.de>2014-09-10 11:22:14 +0200
commit610312aeca9c7443278e6cf0132f6199a9b9ce24 (patch)
treee308ebdc14cbd19242ef4d906c25cd39e1141f8a /bin
parentdfedb80e3fb691dfc5f1eec54ec0b1e5c7821f63 (diff)
downloadjenkins.debian.net-610312aeca9c7443278e6cf0132f6199a9b9ce24.tar.xz
chroot-install: clean downloaded packages
Downloaded packages can consume rather large amounts of space (more than 2GB in some cases). By removing them early, we may be able to avoid writing them to a physical disk reducing the load imposed by the test. The major use case is running chroot-installations on tmpfs.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/chroot-installation.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/chroot-installation.sh b/bin/chroot-installation.sh
index b53d5177..28ac3dd3 100755
--- a/bin/chroot-installation.sh
+++ b/bin/chroot-installation.sh
@@ -58,6 +58,7 @@ prepare_install_packages() {
cat >> $CTMPFILE <<-EOF
$SCRIPT_HEADER
apt-get -y install $@
+apt-get clean
EOF
}
@@ -65,9 +66,11 @@ prepare_install_build_depends() {
cat >> $CTMPFILE <<-EOF
$SCRIPT_HEADER
apt-get -y install build-essential
+apt-get clean
EOF
for PACKAGE in $@ ; do
echo apt-get -y build-dep $PACKAGE >> $CTMPFILE
+ echo apt-get clean >> $CTMPFILE
done
}
@@ -77,8 +80,11 @@ echo "deb $MIRROR $1 main contrib non-free" >> /etc/apt/sources.list
$SCRIPT_HEADER
apt-get update
apt-get -y upgrade
+apt-get clean
apt-get -yf dist-upgrade
+apt-get clean
apt-get -yf dist-upgrade
+apt-get clean
apt-get -y autoremove
EOF
}