[open-ils-commits] r19844 - branches/rel_2_1/build/tools (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 21 20:41:26 EDT 2011
Author: dbs
Date: 2011-03-21 20:41:24 -0400 (Mon, 21 Mar 2011)
New Revision: 19844
Modified:
branches/rel_2_1/build/tools/update_db.sh
Log:
Another layer of escaping for the escapes in the DB update script
Apologies for the previous patch that led to breakage; I "tested" in a
script in which I had already hardcoded the answer I wanted after
running into problems with the previous version of the script. Not
good testing practice.
Thanks to Bill Erickson for suggesting the extra escapes. Tested in
a clean environment this time, and it works.
Modified: branches/rel_2_1/build/tools/update_db.sh
===================================================================
--- branches/rel_2_1/build/tools/update_db.sh 2011-03-22 00:40:44 UTC (rev 19843)
+++ branches/rel_2_1/build/tools/update_db.sh 2011-03-22 00:41:24 UTC (rev 19844)
@@ -56,7 +56,7 @@
PSQL_ACCESS="-h $DB_HOST -U $DB_USER $DB_NAME";
# Need to avoid versions like '1.6.0.4' from throwing off the upgrade
-VERSION=$(psql -c "SELECT MAX(version) FROM config.upgrade_log WHERE version ~ E'^\\d+$'" -t $PSQL_ACCESS);
+VERSION=$(psql -c "SELECT MAX(version) FROM config.upgrade_log WHERE version ~ E'^\\\\d+$'" -t $PSQL_ACCESS);
[ $? -gt 0 ] && die "Database access failed.";
# [ $VERBOSE ] && echo RAW VERSION: $VERSION # TODO: for verbose mode
VERSION=$(echo $VERSION | sed -e 's/^ *0*//'); # This is a separate step so we can check $? above.
More information about the open-ils-commits
mailing list