diff --git a/stack.sh b/stack.sh index 71c661d6c0..f2674905bb 100755 --- a/stack.sh +++ b/stack.sh @@ -678,7 +678,7 @@ if [[ "$OFFLINE" != "True" ]]; then fi # Do the ugly hacks for broken packages and distros -$TOP_DIR/tools/fixup_stuff.sh +source $TOP_DIR/tools/fixup_stuff.sh # Extras Pre-install diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh index 50fb31ce82..d849302a13 100755 --- a/tools/fixup_stuff.sh +++ b/tools/fixup_stuff.sh @@ -20,20 +20,24 @@ # - pre-install hgtools to work around a bug in RHEL6 distribute # - install nose 1.1 from EPEL -set -o errexit -set -o xtrace +# If TOP_DIR is set we're being sourced rather than running stand-alone +# or in a sub-shell +if [[ -z "$TOP_DIR" ]]; then + set -o errexit + set -o xtrace -# Keep track of the current directory -TOOLS_DIR=$(cd $(dirname "$0") && pwd) -TOP_DIR=$(cd $TOOLS_DIR/..; pwd) + # Keep track of the current directory + TOOLS_DIR=$(cd $(dirname "$0") && pwd) + TOP_DIR=$(cd $TOOLS_DIR/..; pwd) -# Change dir to top of devstack -cd $TOP_DIR + # Change dir to top of devstack + cd $TOP_DIR -# Import common functions -source $TOP_DIR/functions + # Import common functions + source $TOP_DIR/functions -FILES=$TOP_DIR/files + FILES=$TOP_DIR/files +fi # Keystone Port Reservation # -------------------------