OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /e/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 17-Nov-2003 10:06:59 Branch: HEAD Handle: 2003111709065800 Modified files: openpkg-src/postgresql pg_migrate postgresql.spec Log: fix pg_migrate and for those running 7.3 (with the broken pg_migrate) tell them how to dump and restore manually Summary: Revision Changes Path 1.5 +14 -1 openpkg-src/postgresql/pg_migrate 1.80 +9 -1 openpkg-src/postgresql/postgresql.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/postgresql/pg_migrate ============================================================================ $ cvs diff -u -r1.4 -r1.5 pg_migrate --- openpkg-src/postgresql/pg_migrate 15 Jul 2003 10:08:30 -0000 1.4 +++ openpkg-src/postgresql/pg_migrate 17 Nov 2003 09:06:58 -0000 1.5 @@ -36,6 +36,14 @@ export LC_CTYPE umask 022 +# check command line +if [ $# -ne 1 ]; then + echo "$0:ERROR: invalid command line" 1>&2 + echo "$0:USAGE: $0 dump|restore" 1>&2 + exit 1 +fi + +# dispatch into commands cmd="$1" shift case $cmd in @@ -78,8 +86,9 @@ done echo "++ dumping all databases into $l_prefix/var/postgresql/db.dump.sql.bz2" + PGPASSWORD="$l_pgpass" \ $l_prefix/bin/pg_dumpall \ - -U $l_pguser -S$l_pgpass -o -Xuse-set-session-authorization |\ + -U $l_pguser -o |\ $l_prefix/lib/openpkg/bzip2 -9 \ >$l_prefix/var/postgresql/db.dump.sql.bz2 chown ${l_rusr}:${l_rgrp} $l_prefix/var/postgresql/db.dump.sql.bz2 @@ -184,6 +193,10 @@ $l_prefix/etc/rc postgresql stop sleep 4 fi + ;; + * ) + echo "$0:ERROR: unknown command \"$cmd\"" 1>&2 + exit 1 ;; esac @@ . patch -p0 <<'@@ .' Index: openpkg-src/postgresql/postgresql.spec ============================================================================ $ cvs diff -u -r1.79 -r1.80 postgresql.spec --- openpkg-src/postgresql/postgresql.spec 17 Nov 2003 08:12:58 -0000 1.79 +++ openpkg-src/postgresql/postgresql.spec 17 Nov 2003 09:06:58 -0000 1.80 @@ -336,7 +336,11 @@ echo "so we strongly recommend that you backup your existing database" echo "($RPM_INSTALL_PREFIX/var/postgresql/db/) first by running:" echo " \$ $RPM_INSTALL_PREFIX/bin/pg_migrate dump" - echo "Alternatively, if you want force this package to be installed without" + echo "If this fails for some reasons, try to dump your data manually:" + echo " \$ $RPM_INSTALL_PREFIX/bin/pg_dumpall -U postgresql -o | \\ " + echo " $RPM_INSTALL_PREFIX/lib/openpkg/bzip2 -9 \\ " + echo " >$RPM_INSTALL_PREFIX/var/postgresql/db.dump.sql.bz2" + echo "Alternatively, if you want to force this package to be installed without" echo "performing a database dump, run the following command before upgrading:" echo " \$ PG_MIGRATE=ignore; export PG_MIGRATE" ) | %{l_rpmtool} msg -b -t error @@ -414,6 +418,10 @@ echo "so we strongly recommend you to recreate the existing database under" echo "$RPM_INSTALL_PREFIX/var/postgresql/db/ by running the following command:" echo " \$ $RPM_INSTALL_PREFIX/bin/pg_dump restore" + echo "If this fails for some reasons, try to restore your data manually:" + echo " \$ $RPM_INSTALL_PREFIX/lib/openpkg/bzip2 -d -c \\ " + echo " $RPM_INSTALL_PREFIX/var/postgresql/db.dump.sql.bz2 | \\ " + echo " $RPM_INSTALL_PREFIX/bin/psql -U postgresql -d template1" ) | %{l_rpmtool} msg -b -t warn fi fi @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]