Ensure contrib/devstack/install.sh works from any path

Change-Id: I56af596488a2774e8426853550823d88759904e0
This commit is contained in:
Kiall Mac Innes 2014-07-01 16:26:24 +01:00
parent a10c19cf20
commit 86554c4aee
1 changed files with 9 additions and 4 deletions

View File

@ -1,9 +1,14 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR=$(readlink -e $(dirname $(readlink -f $0)))
pushd $DIR
for f in lib/* extras.d/* exercises/*; do
echo "Installing symlink for $f"
rm ../../../devstack/$f || true
ln -s $DIR/$f ../../../devstack/$f
if [ ! -e "$DIR/../../../devstack/$f" ]; then
echo "Installing symlink for $f"
ln -fs $DIR/$f $DIR/../../../devstack/$f
fi
done
popd