install.sh: making BUILD_DIR more robust

This commit is contained in:
Brian O'Connor
2013-09-11 12:00:16 -07:00
parent bda54a9aed
commit 389c7aa5af
+4 -4
View File
@@ -10,15 +10,15 @@ set -e
set -o nounset set -o nounset
# Get directory containing mininet folder # Get directory containing mininet folder
MININET_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )" MININET_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd -P )"
# Set up build directory, which by default is the working directory # Set up build directory, which by default is the working directory
# unless the working directory is a subdirectory of mininet, # unless the working directory is a subdirectory of mininet,
# in which case we use the directory containing mininet # in which case we use the directory containing mininet
BUILD_DIR=$PWD BUILD_DIR="$(pwd -P)"
case $PWD in case $BUILD_DIR in
$MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # currect directory is a subdirectory $MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # currect directory is a subdirectory
*) BUILD_DIR=$PWD;; *) BUILD_DIR=$BUILD_DIR;;
esac esac
# Location of CONFIG_NET_NS-enabled kernel(s) # Location of CONFIG_NET_NS-enabled kernel(s)