From f5daf2d5d3f48c97070786591b263fc5d12fefcc Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 22 Feb 2010 23:46:58 +0100 Subject: [PATCH] Support config variable RM_APTCACHE. --- chroot-script | 7 ++++++- config | 3 +++ debian/changelog | 5 ++++- grml-debootstrap | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/chroot-script b/chroot-script index bb770a5..f20faf0 100755 --- a/chroot-script +++ b/chroot-script @@ -131,7 +131,12 @@ EOF # remove now useless apt cache {{{ remove_apt_cache() { - apt-get clean + if [ "$RM_APTCACHE" = 'yes' ] ; then + echo "Cleaning apt cache." + apt-get clean + else + echo "Not cleaning apt cache as \$RM_APTCACHE is unset." + fi } # }}} diff --git a/config b/config index bd75618..1cac751 100644 --- a/config +++ b/config @@ -160,6 +160,9 @@ LOCALES='yes' # use /usr/share/zoneinfo/$TIMEZONE for /etc/localtime TIMEZONE='Europe/Vienna' +# remove apt cache in chroot after installation of packages finished? +RM_APTCACHE='yes' + # generate initrd via update-initramfs? INITRD='yes' diff --git a/debian/changelog b/debian/changelog index a251f58..3117250 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,11 @@ grml-debootstrap (0.34) unstable; urgency=low breaks the way grml-debootstrap used to work. Instead: * Introduce option --nopackages to skip installation of packages defined in /etc/debootstrap/packages. + * Support config variable RM_APTCACHE to allow disabling removal + of apt-cache. Thanks for the idea and initial patch, Tong Sun. + [Closes: issue805] - -- Michael Prokop Mon, 22 Feb 2010 23:33:54 +0100 + -- Michael Prokop Mon, 22 Feb 2010 23:46:13 +0100 grml-debootstrap (0.33) unstable; urgency=low diff --git a/grml-debootstrap b/grml-debootstrap index bdc326c..7a84794 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -794,6 +794,7 @@ preparechroot() { [ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES [ -n "$TARGET" ] && echo "TARGET=$TARGET" >> $CHROOT_VARIABLES [ -n "$TARGET_UUID" ] && echo "TARGET_UUID=$TARGET_UUID" >> $CHROOT_VARIABLES + [ -n "$RM_APTCACHE" ] && echo "RM_APTCACHE=$RM_APTCACHE" >> $CHROOT_VARIABLES cp $VERBOSE $CONFFILES/chroot-script $MNTPOINT/bin/chroot-script chmod 755 $MNTPOINT/bin/chroot-script -- 2.1.4