From 89d50bd6ece06bb4f2f651c508de1b9ca0e6df1f Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 5 Mar 2007 19:54:20 +0000 Subject: [PATCH] support different version of Pg git-svn-id: svn://svn.open-ils.org/ILS/trunk@7024 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/Makefile | 2 +- Open-ILS/src/extras/import/build-oils-db.sh | 4 ++-- Open-ILS/src/sql/Pg/build-db.sh | 3 ++- config.sh | 18 ++++++++++++------ install.conf.default | 1 + 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Open-ILS/src/Makefile b/Open-ILS/src/Makefile index 387a495a43..a425940257 100644 --- a/Open-ILS/src/Makefile +++ b/Open-ILS/src/Makefile @@ -173,7 +173,7 @@ storage-bootstrap: @echo "Type control-c to avoid destroying all of the data. Type enter to continue..." @echo "" @read X; - ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBPORT) $(DBNAME) $(DBUSER) $(DBPW) + ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBPORT) $(DBNAME) $(DBUSER) $(DBPW) $(DBVER) # ----------------------------------------------------------------------------------- diff --git a/Open-ILS/src/extras/import/build-oils-db.sh b/Open-ILS/src/extras/import/build-oils-db.sh index 239da66ae2..b6aa3281cf 100755 --- a/Open-ILS/src/extras/import/build-oils-db.sh +++ b/Open-ILS/src/extras/import/build-oils-db.sh @@ -1,7 +1,7 @@ #!/bin/sh if [ "_$4" == "_" ]; then echo "Usage:" - echo " $0 {Open-ILS-driver} {db-host} {db-port} {db-name} {db-user} {db-password}" + echo " $0 {Open-ILS-driver} {db-host} {db-port} {db-name} {db-user} {db-password} [db-version]" exit 1; fi @@ -12,5 +12,5 @@ WD=`dirname $0` echo "cd $WD/../../sql/$1/;" cd $WD/../../sql/$1/; pwd - ./build-db.sh $2 $3 $4 $5 $6 + ./build-db.sh $2 $3 $4 $5 $6 $7 ) diff --git a/Open-ILS/src/sql/Pg/build-db.sh b/Open-ILS/src/sql/Pg/build-db.sh index f52b968cba..d7faf594ee 100755 --- a/Open-ILS/src/sql/Pg/build-db.sh +++ b/Open-ILS/src/sql/Pg/build-db.sh @@ -1,8 +1,9 @@ #!/bin/sh -# args: {db-host} {db-port} {db-name} {db-user} {db-password} +# args: {db-host} {db-port} {db-name} {db-user} {db-password} {db-version} echo "You may be prompted several times for your database password..." +PGUSER=$4 PGHOST=$1 PGPORT=$2 PGDATABASE=$3 psql -f 000.english.pg$6.fts-config.sql PGUSER=$4 PGHOST=$1 PGPORT=$2 PGDATABASE=$3 psql -f 001.schema.offline.sql PGUSER=$4 PGHOST=$1 PGPORT=$2 PGDATABASE=$3 psql -f 002.schema.config.sql PGUSER=$4 PGHOST=$1 PGPORT=$2 PGDATABASE=$3 psql -f 005.schema.actors.sql diff --git a/config.sh b/config.sh index b8095e900b..e9a9e75f12 100755 --- a/config.sh +++ b/config.sh @@ -83,22 +83,27 @@ function buildConfig { prompt "Build targets [${TARGETS[@]:0}] " read X; if [ ! -z "$X" ]; then TARGETS=("$X"); fi; - prompt "Bootstrapping Database Driver [$DBDRVR] " + prompt "Database Driver [$DBDRVR] " read X; if [ ! -z "$X" ]; then DBDRVR="$X"; fi; - prompt "Bootstrapping Database Host [$DBHOST] " + if [ "$DBDRVR" == "Pg" ]; then + prompt "Bootstrapping Database Version (80 for 8.0.x, 81 for 8.1.x, 82 for 8.2.x) [$DBHOST] " + read X; if [ ! -z "$X" ]; then DBVER="$X"; fi; + fi; + + prompt "Database Host [$DBHOST] " read X; if [ ! -z "$X" ]; then DBHOST="$X"; fi; - prompt "Bootstrapping Database Port [$DBPORT] " + prompt "Database Port [$DBPORT] " read X; if [ ! -z "$X" ]; then DBPORT="$X"; fi; - prompt "Bootstrapping Database Name [$DBNAME] " + prompt "Database Name [$DBNAME] " read X; if [ ! -z "$X" ]; then DBNAME="$X"; fi; - prompt "Bootstrapping Database User [$DBUSER] " + prompt "Database User [$DBUSER] " read X; if [ ! -z "$X" ]; then DBUSER="$X"; fi; - prompt "Bootstrapping Database Password [$DBPW] " + prompt "Database Password [$DBPW] " read X; if [ ! -z "$X" ]; then DBPW="$X"; fi; prompt "Reporter Template Directory [$REPORTERDIR] " @@ -160,6 +165,7 @@ function writeConfig { _write "DBNAME=\"$DBNAME\""; _write "DBUSER=\"$DBUSER\""; _write "DBPW=\"$DBPW\""; + _write "DBVER=\"$DBVER\""; _write "REPORTERDIR=\"$REPORTERDIR\""; _write "ADMINDIR=\"$ADMINDIR\""; diff --git a/install.conf.default b/install.conf.default index cf511ad408..faee21a474 100644 --- a/install.conf.default +++ b/install.conf.default @@ -115,5 +115,6 @@ DBHOST="127.0.0.1"; DBPORT="5432"; DBNAME="demo-dev"; DBUSER="postgres"; +DBVER="82"; DBPW=""; -- 2.11.0