summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2012-01-28 09:16:23 +0000
committerKeith Wall <kwall@apache.org>2012-01-28 09:16:23 +0000
commitbe57a571ef2b008f95a6d01af8565381a47daa70 (patch)
tree084481781cff94c493e3ed4d6ae21c6782a35cca
parent8d3200e6c7808b7b9798f278e4682b9dca58d5cc (diff)
downloadqpid-python-be57a571ef2b008f95a6d01af8565381a47daa70.tar.gz
QPID-3775: Fix path handling in bdb scripts.
Fix bdb scripts backup.sh and storeUpgrade.sh so they successfully handle QPID_HOME and store paths containing spaces. This problem was shown up on Jenkins, as the profile directories of the Jenkins Matrix contain spaces. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1237029 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xjava/bdbstore/bin/backup.sh14
-rwxr-xr-xjava/bdbstore/bin/storeUpgrade.sh8
2 files changed, 14 insertions, 8 deletions
diff --git a/java/bdbstore/bin/backup.sh b/java/bdbstore/bin/backup.sh
index 75f9e1d968..f9e9dc73d2 100755
--- a/java/bdbstore/bin/backup.sh
+++ b/java/bdbstore/bin/backup.sh
@@ -19,22 +19,26 @@
#
# Parse arguments taking all - prefixed args as JAVA_OPTS
+
+declare -a ARGS
for arg in "$@"; do
if [[ $arg == -java:* ]]; then
JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` "
else
- ARGS="${ARGS}$arg "
+ ARGS[${#ARGS[@]}]="$arg"
fi
done
-WHEREAMI=`dirname $0`
if [ -z "$QPID_HOME" ]; then
- export QPID_HOME=`cd $WHEREAMI/../ && pwd`
+ export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
+ export PATH=${PATH}:${QPID_HOME}/bin
fi
+
VERSION=0.15
-LIBS=$QPID_HOME/lib/opt/je-5.0.34.jar:$QPID_HOME/lib/qpid-bdbstore-$VERSION.jar:$QPID_HOME/lib/qpid-all.jar
+# BDB's je JAR expected to be found in lib/opt
+LIBS="${QPID_HOME}/lib/opt/*:${QPID_HOME}/lib/qpid-bdbstore-${VERSION}.jar:${QPID_HOME}/lib/qpid-all.jar"
echo "Starting Hot Backup Script"
-java -Dlog4j.configuration=backup-log4j.xml ${JAVA_OPTS} -cp $LIBS org.apache.qpid.server.store.berkeleydb.BDBBackup ${ARGS}
+java -Dlog4j.configuration=backup-log4j.xml ${JAVA_OPTS} -cp "${LIBS}" org.apache.qpid.server.store.berkeleydb.BDBBackup "${ARGS[@]}"
diff --git a/java/bdbstore/bin/storeUpgrade.sh b/java/bdbstore/bin/storeUpgrade.sh
index dd53529a22..0fb9d4cda6 100755
--- a/java/bdbstore/bin/storeUpgrade.sh
+++ b/java/bdbstore/bin/storeUpgrade.sh
@@ -19,11 +19,12 @@
#
# Parse arguements taking all - prefixed args as JAVA_OPTS
+declare -a ARGS
for arg in "$@"; do
if [[ $arg == -java:* ]]; then
JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` "
else
- ARGS="${ARGS}$arg "
+ ARGS[${#ARGS[@]}]="$arg"
fi
done
@@ -34,6 +35,7 @@ fi
VERSION=0.15
-LIBS=$QPID_HOME/lib/opt/je-5.0.34.jar:$QPID_HOME/lib/qpid-bdbstore-$VERSION.jar:$QPID_HOME/lib/qpid-all.jar
+# BDB's je JAR expected to be found in lib/opt
+LIBS="$QPID_HOME/lib/opt/*:$QPID_HOME/lib/qpid-bdbstore-${VERSION}.jar:$QPID_HOME/lib/qpid-all.jar"
-java -Xms256m -Dlog4j.configuration=BDBStoreUpgrade.log4j.xml -Xmx256m -Damqj.logging.level=warn ${JAVA_OPTS} -cp $LIBS org.apache.qpid.server.store.berkeleydb.BDBStoreUpgrade ${ARGS}
+java -Xms256m -Dlog4j.configuration=BDBStoreUpgrade.log4j.xml -Xmx256m -Damqj.logging.level=warn ${JAVA_OPTS} -cp "${LIBS}" org.apache.qpid.server.store.berkeleydb.BDBStoreUpgrade "${ARGS[@]}"