devstack/install.sh shouldn't rely on exact paths

Currently the contrib/devstack/install.sh script relies on the fact that
designate and devstack are installed side by side. This isn't always
true and can restrict the developer if he keeps his code someplace else
on the filesystem. This patch proposes a change to install.sh which
stores the pwd (where the script assumes devstack is installed,
according to the installation documentation [1]) and uses that directory
instead.

[1]: https://designate.readthedocs.org/en/latest/devstack.html

Change-Id: I97f7762dde56df6e3b9a45198d9201ec0296d94f
Closes-Bug: 1428679
This commit is contained in:
John Schwarz 2015-03-05 17:12:55 +02:00
parent ea00317a3d
commit 8ed2b96318

View File

@ -1,14 +1,15 @@
#!/bin/bash #!/bin/bash
DIR=$(readlink -e $(dirname $(readlink -f $0))) SOURCE_DIR=$(readlink -e $(dirname $(readlink -f $0)))
DEVSTACK_DIR=$(pwd -P)
pushd $DIR pushd $SOURCE_DIR >> /dev/null
for f in lib/* extras.d/* exercises/*; do for path in lib/* extras.d/* exercises/*; do
if [ ! -e "$DIR/../../../devstack/$f" ]; then if [ ! -e "$DEVSTACK_DIR/$path" ]; then
echo "Installing symlink for $f" echo "Installing symlink for $path"
ln -fs $DIR/$f $DIR/../../../devstack/$f ln -fs $SOURCE_DIR/$path $DEVSTACK_DIR/$path
fi fi
done done
popd popd >> /dev/null