Move stages to /var/cache/grml-debootstrap
authorMichael Prokop <devnull@localhost>
Thu, 28 Aug 2008 13:07:14 +0000 (15:07 +0200)
committerMichael Prokop <devnull@localhost>
Thu, 28 Aug 2008 13:07:14 +0000 (15:07 +0200)
debian/changelog
grml-debootstrap

index 4a3937a..36157e6 100644 (file)
@@ -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.
     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 <mika@grml.org>  Thu, 28 Aug 2008 14:59:15 +0200
+ -- Michael Prokop <mika@grml.org>  Thu, 28 Aug 2008 15:06:48 +0200
 
 grml-debootstrap (0.17) unstable; urgency=low
 
 
 grml-debootstrap (0.17) unstable; urgency=low
 
index 79f10ad..0611494 100755 (executable)
@@ -464,7 +464,7 @@ fi
 
 # stages setup {{{
 if [ -z "$STAGES" ] ; then
 
 # 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
 
    [ -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 $?
 
         [ -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 $?
         # 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
 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
 # }}}
     fi
 done
 # }}}