Browse code

Merge "Source fixup_stuff..."

Jenkins authored on 2014/08/23 17:25:39
Showing 2 changed files
... ...
@@ -678,7 +678,7 @@ if [[ "$OFFLINE" != "True" ]]; then
678 678
 fi
679 679
 
680 680
 # Do the ugly hacks for broken packages and distros
681
-$TOP_DIR/tools/fixup_stuff.sh
681
+source $TOP_DIR/tools/fixup_stuff.sh
682 682
 
683 683
 
684 684
 # Extras Pre-install
... ...
@@ -20,20 +20,24 @@
20 20
 #   - pre-install hgtools to work around a bug in RHEL6 distribute
21 21
 #   - install nose 1.1 from EPEL
22 22
 
23
-set -o errexit
24
-set -o xtrace
23
+# If TOP_DIR is set we're being sourced rather than running stand-alone
24
+# or in a sub-shell
25
+if [[ -z "$TOP_DIR" ]]; then
26
+    set -o errexit
27
+    set -o xtrace
25 28
 
26
-# Keep track of the current directory
27
-TOOLS_DIR=$(cd $(dirname "$0") && pwd)
28
-TOP_DIR=$(cd $TOOLS_DIR/..; pwd)
29
+    # Keep track of the current directory
30
+    TOOLS_DIR=$(cd $(dirname "$0") && pwd)
31
+    TOP_DIR=$(cd $TOOLS_DIR/..; pwd)
29 32
 
30
-# Change dir to top of devstack
31
-cd $TOP_DIR
33
+    # Change dir to top of devstack
34
+    cd $TOP_DIR
32 35
 
33
-# Import common functions
34
-source $TOP_DIR/functions
36
+    # Import common functions
37
+    source $TOP_DIR/functions
35 38
 
36
-FILES=$TOP_DIR/files
39
+    FILES=$TOP_DIR/files
40
+fi
37 41
 
38 42
 # Keystone Port Reservation
39 43
 # -------------------------