[open-ils-commits] [GIT] Evergreen ILS branch master updated. 10ed91a20a1f76d452688b0033b8a33b7d988e32

Evergreen Git git at git.evergreen-ils.org
Wed Sep 28 11:07:58 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  10ed91a20a1f76d452688b0033b8a33b7d988e32 (commit)
      from  54a691aa0206e9f4d4d9cba24bd4c1e49e774b83 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 10ed91a20a1f76d452688b0033b8a33b7d988e32
Author: Mike Rylander <mrylander at gmail.com>
Date:   Tue Sep 27 11:46:03 2011 -0400

    Teach update_db.sh to find the currently installed version number via eg_config and supply that when applying updates
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/build/tools/update_db.sh b/build/tools/update_db.sh
index e4130c2..3177f1b 100755
--- a/build/tools/update_db.sh
+++ b/build/tools/update_db.sh
@@ -55,6 +55,11 @@ function feedback() {
 
 PSQL_ACCESS="-h $DB_HOST -U $DB_USER $DB_NAME";
 
+# Find the current version of Evergreen, which is the installed version to which the upgrade script is being applied
+EGVERSION=$(eg_config --version|cut -f2 -d' ');
+[  $? -gt 0  ] && die "Could not find eg_config, please make sure it is in your path.";
+[  -z "$EGVERSION"  ] && die "Could not determine Evergreen version from eg_config.";
+
 # 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);
 [  $? -gt 0  ] && die "Database access failed.";
@@ -101,7 +106,7 @@ if [ $COUNT -gt 0 ] ; then
     for (( i=0; i<$COUNT; i++ )) ; do
         echo "* Applying ${FILES[$i]}" >&3;   # to the main script STDOUT
         cat ${FILES[$i]};                     # to the psql pipe
-    done | psql $PSQL_ACCESS ;
+    done | psql -set eg_version="'$EGVERSION'" $PSQL_ACCESS ;
 else
     echo "* Nothing to update";
 fi

-----------------------------------------------------------------------

Summary of changes:
 build/tools/update_db.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list