- fix host setting
authorMichael Schröder <mls@suse.de>
Wed, 14 May 2008 10:34:17 +0000 (10:34 +0000)
committerMichael Schröder <mls@suse.de>
Wed, 14 May 2008 10:34:17 +0000 (10:34 +0000)
- use umount on build root, it's more stable

build

diff --git a/build b/build
index 0c5290a..3038162 100755 (executable)
--- a/build
+++ b/build
@@ -171,7 +171,8 @@ cleanup_and_exit () {
     else
        umount -n $BUILD_ROOT/proc 2>/dev/null || true
        umount -n $BUILD_ROOT/dev/pts 2>/dev/null || true
-       [ -n "$VM_IMAGE" ] && umount "$VM_IMAGE" 2>/dev/null || true
+       test "$VM_IMAGE" = 1 && VM_IMAGE=
+       [ -n "$VM_IMAGE" ] && umount $BUILD_ROOT 2>/dev/null || true
     fi
     exit $1
 }
@@ -458,11 +459,10 @@ mkdir_build_root()
 
 shopt -s nullglob
 
-if detect_xen_2nd_stage; then
+if detect_xen_2nd_stage ; then
     set "/.build-srcdir/$SPECFILE"
-else
-    export HOST
 fi
+export HOST
 
 while test -n "$1"; do
   PARAM="$1"
@@ -887,7 +887,7 @@ for SPECFILE in "${SPECFILES[@]}" ; do
        umount -n $BUILD_ROOT/proc 2> /dev/null || true
        umount -n $BUILD_ROOT/dev/pts 2> /dev/null || true
        umount -n $BUILD_ROOT/mnt 2> /dev/null || true
-       umount $VM_IMAGE
+       umount $BUILD_ROOT
 
        if [ -n "$USE_XEN" ]; then
                XMROOT=file:$VM_IMAGE