Browse code

Merge branch 'master' of github.com:cloudbuilders/devstack

Jesse Andrews authored on 2011/10/20 07:38:17
Showing 2 changed files
... ...
@@ -270,8 +270,11 @@ failed() {
270 270
 # an error.  It is also useful for following along as the install occurs.
271 271
 set -o xtrace
272 272
 
273
+# create the destination directory and ensure it is writable by the user
273 274
 sudo mkdir -p $DEST
274
-sudo chown `whoami` $DEST
275
+if [ ! -w $DEST ]; then
276
+    sudo chown `whoami` $DEST
277
+fi
275 278
 
276 279
 # Install Packages
277 280
 # ================
... ...
@@ -300,8 +303,6 @@ function git_clone {
300 300
     fi
301 301
 
302 302
     if [ ! -d $2 ]; then
303
-        sudo mkdir $2
304
-        sudo chown `whoami` $2
305 303
         git clone $1 $2
306 304
         cd $2
307 305
         # This checkout syntax works for both branches and tags
... ...
@@ -21,22 +21,25 @@ if [ -b $DEST_DIR ]; then
21 21
     # We have a block device, install syslinux and mount it
22 22
     DEST_DEV=$DEST_DIR
23 23
     DEST_DIR=`mktemp -d mntXXXXXX`
24
+    mount $DEST_DEV $DEST_DIR
25
+
26
+    if [ ! -d $DEST_DIR/syslinux ]; then
27
+        mkdir -p $DEST_DIR/syslinux
28
+    fi
24 29
 
25 30
     # Install syslinux on the device
26 31
     syslinux --install --directory syslinux $DEST_DEV
27
-
28
-    mount $DEST_DEV $DEST_DIR
29 32
 else
30 33
     # We have a directory (for sanity checking output)
31
-	DEST_DEV=""
32
-	if [ ! -d $DEST_DIR/syslinux ]; then
33
-	    mkdir -p $DEST_DIR/syslinux
34
-	fi
34
+    DEST_DEV=""
35
+    if [ ! -d $DEST_DIR/syslinux ]; then
36
+        mkdir -p $DEST_DIR/syslinux
37
+    fi
35 38
 fi
36 39
 
37 40
 # Get some more stuff from syslinux
38 41
 for i in memdisk menu.c32; do
39
-	cp -p /usr/lib/syslinux/$i $DEST_DIR/syslinux
42
+    cp -p /usr/lib/syslinux/$i $DEST_DIR/syslinux
40 43
 done
41 44
 
42 45
 CFG=$DEST_DIR/syslinux/syslinux.cfg