Bug#926214: debootstrap: clean up /var/cache/apt/archives/*
control: severity -1 wishlist
control: tags -1 +patch
Hi,
Here's a patch.
diff --git a/debootstrap b/debootstrap
index 8fbf954..397bc09 100755
--- a/debootstrap
+++ b/debootstrap
@@ -33,6 +33,7 @@ ARCH=""
HOST_ARCH=""
HOST_OS=""
KEEP_DEBOOTSTRAP_DIR=""
+KEEP_APT_CACHE=""
USE_DEBIANINSTALLER_INTERACTION=""
SECOND_STAGE_ONLY=""
CHROOTDIR=""
@@ -227,6 +228,10 @@ if [ $# != 0 ] ; then
KEEP_DEBOOTSTRAP_DIR=true
shift
;;
+ --keep-apt-cache)
+ KEEP_APT_CACHE=true
+ shift
+ ;;
--arch|--arch=?*)
if [ "$1" = "--arch" ] && [ -n "$2" ] ; then
ARCH="$2"
@@ -840,6 +845,10 @@ if am_doing_phase second_stage; then
fi
fi
+if [ ! "$KEEP_APT_CACHE" = true ]; then
+ rm -rf "$TARGET/var/cache/apt/archives" "$TARGET/var/lib/apt/lists"
+fi
+
if am_doing_phase kill_target; then
if [ "$KEEP_DEBOOTSTRAP_DIR" != true ]; then
info KILLTARGET "Deleting target directory"
Reply to: