From 44ad9c24c021fca56e534504ed0d582cba5252a0 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 28 Aug 2008 15:07:14 +0200 Subject: [PATCH] Move stages to /var/cache/grml-debootstrap --- debian/changelog | 4 +++- grml-debootstrap | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4a3937a..36157e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,8 +18,10 @@ grml-debootstrap (0.18) unstable; urgency=low the same configuration as specified on the cmdline (thanks gebi for reporting). * Copy system's /etc/hosts to the target system. + * Move stages to /var/cache/grml-debootstrap (thanks for the idea, + gebi). - -- Michael Prokop Thu, 28 Aug 2008 14:59:15 +0200 + -- Michael Prokop Thu, 28 Aug 2008 15:06:48 +0200 grml-debootstrap (0.17) unstable; urgency=low diff --git a/grml-debootstrap b/grml-debootstrap index 79f10ad..0611494 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -464,7 +464,7 @@ fi # stages setup {{{ if [ -z "$STAGES" ] ; then - STAGES="/etc/debootstrap/stages_${SHORT_TARGET}" + STAGES="/var/cache/grml-debootstrap/stages_${SHORT_TARGET}" [ -d "$STAGES" ] || mkdir -p "$STAGES" fi @@ -554,6 +554,11 @@ bailout(){ [ -d "$MNTPOINT/$ISODIR" ] && umount "$MNTPOINT/$ISODIR" 1>/dev/null 2>&1 einfo "Unmounting $MNTPOINT" ; umount "$MNTPOINT" ; eend $? + if [ -n "$STAGES" ] ; then + echo -n "Removing stages directory ${STAGES}: " + rm -rf "$STAGES" && echo done + fi + # remove directory only if we used the default with process id inside the name if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then einfo "Removing directory ${MNTPOINT}" ; rmdir $MNTPOINT ; eend $? @@ -776,7 +781,7 @@ fscktool() { for i in mkfs tunefs mount_target debootstrap_system preparechroot \ chrootscript grub_install umount_chroot fscktool ; do if stage "${i}" ; then - $i && ( stage "${i}" done && rmdir "${STAGES}/${1}" ) || bailout 2 "i" + $i && ( stage "${i}" done && rm -f "${STAGES}/${i}" ) || bailout 2 "i" fi done # }}} -- 2.1.4