Support config variable RM_APTCACHE.
authorMichael Prokop <mika@grml.org>
Mon, 22 Feb 2010 22:46:58 +0000 (23:46 +0100)
committerMichael Prokop <mika@grml.org>
Mon, 22 Feb 2010 22:46:58 +0000 (23:46 +0100)
chroot-script
config
debian/changelog
grml-debootstrap

index bb770a5..f20faf0 100755 (executable)
@@ -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 (file)
--- 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'
 
index a251f58..3117250 100644 (file)
@@ -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 <mika@grml.org>  Mon, 22 Feb 2010 23:33:54 +0100
+ -- Michael Prokop <mika@grml.org>  Mon, 22 Feb 2010 23:46:13 +0100
 
 grml-debootstrap (0.33) unstable; urgency=low
 
index bdc326c..7a84794 100755 (executable)
@@ -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