[Koha-patches] [PATCH] fix for bug 2528: installation fails with confusing error message

Jesse Weaver jesse.weaver at liblime.com
Mon Aug 18 19:37:55 CEST 2008


This makes the dns check happen earlier, and fail humanely if there is a problem.
---
 rewrite-config.PL |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/rewrite-config.PL b/rewrite-config.PL
index 69b070a..6167c5e 100644
--- a/rewrite-config.PL
+++ b/rewrite-config.PL
@@ -64,7 +64,11 @@ $myhost = hostname();
 $mydomain = $myhost;
 $mydomain =~ s/^.*?\.//;
 # This is set here to rescue systems with broken DNS
-$myip = $ENV{'WEBSERVER_IP'} || inet_ntoa(scalar gethostbyname($myhost||'localhost')) || die "Cannot get our own IP address: DNS fault?";
+if ( !gethostbyname( $myhost || 'localhost' ) ) {
+    die 'Could not get the IP address of ' . ( $myhost || 'localhost' ) . ', DNS fault?';
+}
+
+$myip = $ENV{'WEBSERVER_IP'} || inet_ntoa( scalar gethostbyname( $myhost||'localhost' ) );
 $prefix = $ENV{'INSTALL_BASE'} || "/usr";
 
 # These are our configuration guesses
-- 
1.5.5.GIT




More information about the Koha-patches mailing list