From aa74b5a5ae5f93112a7f179b221196d45ed7ee9b Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 24 Jun 2015 08:43:29 -0500 Subject: [PATCH] install_rally.sh: permit absolute paths for sqlite db name If the SQLite database name (--db-name) starts with a /, assume that it's an absolute path, instead of being relative to $RALLY_DATABASE_DIR (which is not configurable). Change-Id: Ief9485f4dd7f8d2becdb2ebfd78cf29b411aece7 --- install_rally.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install_rally.sh b/install_rally.sh index 137653379e..52c4587dc3 100755 --- a/install_rally.sh +++ b/install_rally.sh @@ -574,8 +574,13 @@ then RALLY_DATABASE_DIR="$VENVDIR"/database fi -if [ "$DBTYPE" != 'sqlite' ] -then +if [ "$DBTYPE" = 'sqlite' ]; then + if [ "${DBNAME:0:1}" = '/' ]; then + DBCONNSTRING="$DBTYPE:///$DBNAME" + else + DBCONNSTRING="$DBTYPE:///${RALLY_DATABASE_DIR}/${DBNAME}" + fi +else if [ -z "$DBUSER" -o -z "$DBPASSWORD" -o -z "$DBHOST" -o -z "$DBNAME" ] then die $EX_USAGE "Missing mandatory options" <<__EOF__ @@ -593,8 +598,6 @@ __EOF__ fi DBAUTH="$DBUSER:$DBPASSWORD@$DBHOST" DBCONNSTRING="$DBTYPE://$DBAUTH/$DBNAME" -else - DBCONNSTRING="$DBTYPE:///${RALLY_DATABASE_DIR}/${DBNAME}" fi # check and install prerequisites