[postgresql/f18] postgresql-setup: fail earlier during bad $PGDATA dir creation

Pavel Raiskup praiskup at fedoraproject.org
Mon Aug 12 12:12:58 UTC 2013


commit 53cfd065ee1ac90a737e7b4a46f8e8feee36a459
Author: Pavel Raiskup <praiskup at redhat.com>
Date:   Tue Jun 11 11:00:56 2013 +0200

    postgresql-setup: fail earlier during bad $PGDATA dir creation
    
    (cherry pick from fc20)
    
    Related: #972425
    Version: 9.2.4-2

 postgresql-setup |    4 ++--
 postgresql.spec  |   11 ++++++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/postgresql-setup b/postgresql-setup
index e566106..a755e11 100644
--- a/postgresql-setup
+++ b/postgresql-setup
@@ -66,9 +66,9 @@ script_result=0
 
 # code shared between initdb and upgrade actions
 perform_initdb(){
-	if [ ! -e "$PGDATA" -a ! -h "$PGDATA" ]
+	if [ ! -e "$PGDATA" ]
 	then
-		mkdir -p "$PGDATA" || return 1
+		mkdir "$PGDATA" || return 1
 		chown postgres:postgres "$PGDATA"
 		chmod go-rwx "$PGDATA"
 	fi
diff --git a/postgresql.spec b/postgresql.spec
index 0e3889d..5c18840 100644
--- a/postgresql.spec
+++ b/postgresql.spec
@@ -58,7 +58,7 @@ Summary: PostgreSQL client programs
 Name: postgresql
 %global majorversion 9.2
 Version: 9.2.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 # The PostgreSQL license is very similar to other MIT licenses, but the OSI
 # recognizes it as an independent license, so we do as well.
@@ -103,6 +103,9 @@ Patch4: postgresql-config-comment.patch
 Patch5: postgresql-multi-sockets.patch
 Patch6: postgresql-var-run-socket.patch
 
+# Comments for these patches are in the patch files.
+Patch7: postgresql-man.patch
+
 BuildRequires: perl(ExtUtils::MakeMaker) glibc-devel bison flex gawk
 BuildRequires: perl(ExtUtils::Embed), perl-devel
 BuildRequires: readline-devel zlib-devel
@@ -329,6 +332,7 @@ benchmarks.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 # We used to run autoconf here, but there's no longer any real need to,
 # since Postgres ships with a reasonably modern configure script.
@@ -1097,6 +1101,11 @@ fi
 %endif
 
 %changelog
+* Mon Aug 12 2013 Pavel Raiskup <praiskup at redhat.com> - 9.2.4-2
+- postgresql-setup: don't create whole path to server's data to make sure that
+  the parent directory has correct permissions (#972425) (pick from fc20)
+- backport fix for manual pages (#948933) (pick from fc20)
+
 * Thu Apr  4 2013 Tom Lane <tgl at redhat.com> 9.2.4-1
 - Update to PostgreSQL 9.2.4, for various fixes described at
   http://www.postgresql.org/docs/9.2/static/release-9-2-4.html


More information about the scm-commits mailing list