From: Stefano Zacchiroli Date: Mon, 14 Nov 2005 13:25:59 +0000 (+0000) Subject: bugfix, use database name X-Git-Tag: V_0_7_2_3~86 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=fc8c8c46a0f97ab7f69898bcccbae6a6a8d2591b;p=helm.git bugfix, use database name --- diff --git a/helm/matita/dist/fill_db.sh b/helm/matita/dist/fill_db.sh index e4e984308..1ae28d336 100755 --- a/helm/matita/dist/fill_db.sh +++ b/helm/matita/dist/fill_db.sh @@ -21,31 +21,32 @@ function appendsql() echo "$1" >> $SQL } -echo "# SQL statements to create Matita DB" > $SQL +echo "Step 0." +echo " Dropping old databases, if any." +echo " You can ignore errors output by this step" +echo "$drop_sql" | $MYSQL -f +echo "Step 1." +echo " Creating database and users." +echo "# SQL statements to create Matita DB and users" > $SQL appendsql "$create_sql;" if [ -z "$DBPASS" ]; then appendsql "$grant_sql;" else appendsql "$grant_sql IDENTIFIED BY '$DBPASS';" fi +$MYSQL < $SQL +echo "Step 2." +echo " Creating database structure." +echo "# SQL statements to create Matita DB structure" > $SQL creator_args="table fill index" for arg in $creator_args; do - for line in `$TABLE_CREATOR $arg all`; do - appendsql $line - done + appendsql "`$TABLE_CREATOR $arg all`" done - -echo "Step 1." -echo " Dropping old databases, if any." -echo " You can ignore errors output by this step" -echo "$drop_sql" | $MYSQL -f -echo "Step 2." -echo " Creating database structure using SQL statements from $SQL." -$MYSQL < $SQL +$MYSQL $DBNAME < $SQL echo "Step 3." echo " Filling database with standard library metadata." if [ -f "$STDLIB_DATA" ]; then - gunzip -c "$STDLIB_DATA" | $MYSQL + gunzip -c "$STDLIB_DATA" | $MYSQL $DBNAME else echo " Standard library metadata file $STDLIB_DATA not found, skipping this step." fi