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
This commit is contained in:
Chris St. Pierre 2015-06-24 08:43:29 -05:00
parent 48e8c56830
commit aa74b5a5ae

View File

@ -574,8 +574,13 @@ then
RALLY_DATABASE_DIR="$VENVDIR"/database RALLY_DATABASE_DIR="$VENVDIR"/database
fi fi
if [ "$DBTYPE" != 'sqlite' ] if [ "$DBTYPE" = 'sqlite' ]; then
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" ] if [ -z "$DBUSER" -o -z "$DBPASSWORD" -o -z "$DBHOST" -o -z "$DBNAME" ]
then then
die $EX_USAGE "Missing mandatory options" <<__EOF__ die $EX_USAGE "Missing mandatory options" <<__EOF__
@ -593,8 +598,6 @@ __EOF__
fi fi
DBAUTH="$DBUSER:$DBPASSWORD@$DBHOST" DBAUTH="$DBUSER:$DBPASSWORD@$DBHOST"
DBCONNSTRING="$DBTYPE://$DBAUTH/$DBNAME" DBCONNSTRING="$DBTYPE://$DBAUTH/$DBNAME"
else
DBCONNSTRING="$DBTYPE:///${RALLY_DATABASE_DIR}/${DBNAME}"
fi fi
# check and install prerequisites # check and install prerequisites