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 !~ /[EMAIL PROTECTED]/) {
- $@ = '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;