X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=grml-debootstrap;h=06114949a3eb92d7c2ec573037a2403c9b3b2944;hb=44ad9c24c021fca56e534504ed0d582cba5252a0;hp=79f10ad912d2a1b6f22fe1064d16aacb9f67873e;hpb=f7894c712f146f42cedcd4352f1f3b2f90ce64c2;p=grml-debootstrap.git 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 # }}}