OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /v/openpkg/cvs                   Email:  r...@openpkg.org
  Module: openpkg-src                      Date:   13-Jul-2009 22:04:34
  Branch: HEAD                             Handle: 2009071321043301

  Modified files:
    openpkg-src/postgresql  pg_migrate postgresql.spec

  Log:
    improve pg_migrate script

  Summary:
    Revision    Changes     Path
    1.13        +13 -8      openpkg-src/postgresql/pg_migrate
    1.283       +1  -1      openpkg-src/postgresql/postgresql.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/postgresql/pg_migrate
  ============================================================================
  $ cvs diff -u -r1.12 -r1.13 pg_migrate
  --- openpkg-src/postgresql/pg_migrate 6 Sep 2007 09:25:38 -0000       1.12
  +++ openpkg-src/postgresql/pg_migrate 13 Jul 2009 20:04:33 -0000      1.13
  @@ -32,12 +32,14 @@
   l_pgdata=""
   l_pguser=""
   l_pgpass=""
  -if [ -r @l_prefix@/var/db/postgresql/pg_superuser.conf ]; then
  -    eval `. @l_prefix@/var/db/postgresql/pg_superuser.conf; \
  -          echo l_pgdata=\"$superuser_database\"; \
  -          echo l_pguser=\"$superuser_username\"; \
  -          echo l_pgpass=\"$superuser_password\"`
  +if [ ! -r $l_prefix/var/db/postgresql/pg_superuser.conf ]; then
  +    echo "$0:ERROR: unable to read file 
\"$l_prefix/var/db/postgresql/pg_superuser.conf\" (use pg_passwd(1) to create)" 
1>&2
  +    exit 1
   fi
  +eval `. $l_prefix/var/db/postgresql/pg_superuser.conf; \
  +      echo l_pgdata=\"$superuser_database\"; \
  +      echo l_pguser=\"$superuser_username\"; \
  +      echo l_pgpass=\"$superuser_password\"`
   
   #   establish sane environment
   LC_CTYPE=C
  @@ -65,7 +67,10 @@
             echo "host all 127.0.0.1 255.255.255.255 trust"
           ) >$l_prefix/var/postgresql/db/pg_hba.conf
   
  -        if [ ".`$l_prefix/bin/openpkg rc postgresql status 2>&1 | grep 'is 
running'`" != . ]; then
  +        ( eval `${l_prefix}/bin/openpkg rc postgresql status 2>/dev/null`
  +          echo "postgresql_active=\"$postgresql_active\""
  +        ) 2>/dev/null
  +        if [ ".$postgresql_active" = .yes ]; then
               echo "++ reloading already running database engine"
               $l_prefix/bin/openpkg rc postgresql reload
               sleep 2
  @@ -98,7 +103,7 @@
           echo "++ dumping all databases into 
$l_prefix/var/postgresql/db.dump.sql.bz2"
           PGPASSWORD="$l_pgpass" \
           $l_prefix/bin/pg_dumpall \
  -            -U $l_pguser -o |\
  +            -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
  @@ -187,7 +192,7 @@
           echo "++ restoring all databases from 
$l_prefix/var/postgresql/db.dump.sql.bz2"
           $l_prefix/lib/openpkg/bzip2 -c -d \
               $l_prefix/var/postgresql/db.dump.sql.bz2 |\
  -                $l_prefix/bin/psql -U $l_pguser -d $l_pgdata 2>&1 |\
  +                $l_prefix/bin/psql -U "$l_pguser" -d "$l_pgdata" 2>&1 |\
                       tee $l_prefix/var/postgresql/db.log |\
                           $l_prefix/lib/openpkg/shtool prop \
                               -p "++ restoring data (see 
$l_prefix/var/postgresql/db.log)"
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/postgresql/postgresql.spec
  ============================================================================
  $ cvs diff -u -r1.282 -r1.283 postgresql.spec
  --- openpkg-src/postgresql/postgresql.spec    12 Jul 2009 13:09:49 -0000      
1.282
  +++ openpkg-src/postgresql/postgresql.spec    13 Jul 2009 20:04:34 -0000      
1.283
  @@ -48,7 +48,7 @@
   Group:        Database
   License:      GPL
   Version:      %{V_postgresql}
  -Release:      20090712
  +Release:      20090713
   
   #   package options
   %option       with_server       yes
  @@ .
______________________________________________________________________
OpenPKG                                             http://openpkg.org
CVS Repository Commit List                     openpkg-cvs@openpkg.org

Reply via email to