Remove the guest in case of failure.
authorDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 20 Mar 2007 17:47:04 +0000 (17:47 +0000)
committerDaniel Hokka Zakrisson <daniel@hozac.com>
Tue, 20 Mar 2007 17:47:04 +0000 (17:47 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2519 94cd875c-1c1d-0410-91d2-eb244daf1a30

scripts/vserver-build.debootstrap

index dfbcc56..ebd9ca8 100644 (file)
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-function cleanUp
-{
-    test ! -d "$workdir"  || $_RM -rf "$workdir"
-}
-
 function init
 {
     workdir=
     mirror=
-    trap "cleanUp" EXIT
 }
 
 function initVariables
@@ -55,6 +49,8 @@ function findDebootstrap
         dir=$($_MKTEMPDIR -p /var/tmp debootstrap.XXXXXX)
         workdir=$dir
         dst=$dir/debootstrap.deb
+
+        base._addGeneratedFile "$workdir"
         
         findFile DEBOOTSTRAP_URI "$__CONFDIR"/.defaults/apps/debootstrap/uri "$__PKGLIBDEFAULTDIR"/debootstrap.uri
         read tmp <$DEBOOTSTRAP_URI