From 389c7aa5af5a45cf6b982da8186a58910b5b8d75 Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Tue, 27 Aug 2013 17:42:46 -0700 Subject: [PATCH] install.sh: making BUILD_DIR more robust --- util/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/install.sh b/util/install.sh index 5ffbc92..cf74dc6 100755 --- a/util/install.sh +++ b/util/install.sh @@ -10,15 +10,15 @@ set -e set -o nounset # 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 # unless the working directory is a subdirectory of mininet, # in which case we use the directory containing mininet -BUILD_DIR=$PWD -case $PWD in +BUILD_DIR="$(pwd -P)" +case $BUILD_DIR in $MININET_DIR/*) BUILD_DIR=$MININET_DIR;; # currect directory is a subdirectory - *) BUILD_DIR=$PWD;; + *) BUILD_DIR=$BUILD_DIR;; esac # Location of CONFIG_NET_NS-enabled kernel(s)