[issue805] grml-debootstrap, make removing apt cache chroot-script operations configurable

Tong Sun bts at bts.grml.org
Wed Jan 27 20:29:28 CET 2010


Tong Sun <suntong at cpan.org> added the comment:

fixed
---
 chroot-script    |    4 +++-
 config           |    3 +++
 grml-debootstrap |    1 +
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/chroot-script b/chroot-script
index d1bdb95..9b56024 100755
--- a/chroot-script
+++ b/chroot-script
@@ -131,7 +131,9 @@ EOF
 
 # remove now useless apt cache {{{
 remove_apt_cache() {
-  apt-get clean
+  apt-get autoremove
+  apt-get autoclean
+  [ "$RM_DEBS" = 'yes' ] && apt-get clean
 }
 # }}}
 
diff --git a/config b/config
index a0cdb11..ee4238e 100644
--- a/config
+++ b/config
@@ -163,6 +163,9 @@ TIMEZONE='Europe/Vienna'
 # generate initrd via update-initramfs?
 INITRD='yes'
 
+# specify RM_DEBS='yes' to wipe out apt cache in chroot after grml-debootstrap
+RM_DEBS=
+
 # this file contains information that has been caught during
 # installation and will be displayed at the end of the installation
 INSTALL_NOTES='/etc/debootstrap/install_notes'
diff --git a/grml-debootstrap b/grml-debootstrap
index 7edc29b..b97261d 100755
--- a/grml-debootstrap
+++ b/grml-debootstrap
@@ -791,6 +791,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_DEBS" ]	  && echo "RM_DEBS=$RM_DEBS"   >> $CHROOT_VARIABLES
 
   cp $VERBOSE $CONFFILES/chroot-script $MNTPOINT/bin/chroot-script
   chmod 755 $MNTPOINT/bin/chroot-script
-- 
1.6.5

----------
messages: 2864, 2867, 2869
nosy: suntong
priority: bug
status: chatting
title: grml-debootstrap, make removing apt cache chroot-script operations configurable

_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue805>
_____________________________________


More information about the Bugs-changes mailing list