Use do_on_exit() in build scripts for cleanup

This commit is contained in:
Reto Buerki
2013-01-17 15:22:11 +01:00
committed by Tobias Brunner
parent 9a045eef8e
commit 0cc4063799
3 changed files with 11 additions and 9 deletions
+3 -3
View File
@@ -32,6 +32,9 @@ log_action "Mounting cache to $CACHEDIR"
mkdir -p $APTCACHE
execute "mount -o bind $CACHEDIR $APTCACHE"
do_on_exit umount -l $APTCACHE
do_on_exit umount -l $LOOPDIR
log_action "Running debootstrap ($ROOTFSSUITE, $ROOTFSARCH)"
execute "debootstrap --arch=$ROOTFSARCH --include=$PACKAGES $ROOTFSSUITE $LOOPDIR $ROOTFSMIRROR"
@@ -45,6 +48,3 @@ do
log_action "Disabling service $service"
execute_chroot "update-rc.d -f $service remove"
done
execute "umount -l $APTCACHE" 0
execute "umount -l $LOOPDIR" 0