develooper Front page | perl.dbd.pg.changes | Postings from May 2008

[svn:DBD-Pg] r11173 - DBD-Pg/trunk/t

From:
turnstep
Date:
May 1, 2008 14:28
Subject:
[svn:DBD-Pg] r11173 - DBD-Pg/trunk/t
Author: turnstep
Date: Thu May  1 14:28:04 2008
New Revision: 11173

Modified:
   DBD-Pg/trunk/t/dbdpg_test_setup.pl

Log:
Tweak initdb error output.


Modified: DBD-Pg/trunk/t/dbdpg_test_setup.pl
==============================================================================
--- DBD-Pg/trunk/t/dbdpg_test_setup.pl	(original)
+++ DBD-Pg/trunk/t/dbdpg_test_setup.pl	Thu May  1 14:28:04 2008
@@ -195,7 +195,7 @@
 		last GETHANDLE if $@;
 
 		if (!defined $info or $info !~ /\@postgresql\.org/) {
-			$@ = 'Bad initdb output';
+			$@ = "Bad initdb output: $info";
 			last GETHANDLE;
 		}
 
@@ -207,11 +207,6 @@
 		};
 		last GETHANDLE if $@;
 
-		if ($info =~ /FATAL/) {
-			$@ = "initdb gave a FATAL error: $info";
-			last GETHANDLE;
-		}
-
 		## initdb and pg_ctl cannot be run as root, so let's handle that
 		if ($info =~ /run as root/) {
 			eval {
@@ -258,6 +253,16 @@
 			## At this point, both $su and $testuser are set
 		}
 
+		if ($info =~ /FATAL/) {
+			$@ = "initdb gave a FATAL error: $info";
+			last GETHANDLE;
+		}
+
+		if ($info !~ /pg_ctl/) {
+			$@ = "initdb did not give a pg_ctl string: $info";
+			last GETHANDLE;
+		}
+
 		## Which user do we connect as?
 		if (!$su and $info =~ /owned by user "(.+?)"/) {
 			$testuser = $1;



Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About