From: cphillip Date: Tue, 6 May 2003 18:43:56 +0000 (+0000) Subject: o die improvements to keep gpt-postinstall from croaking should an X-Git-Tag: OPENSSH_GSI_GPT_2_3~4 X-Git-Url: http://andersk.mit.edu/gitweb/gssapi-openssh.git/commitdiff_plain/74d5d5829a7ad5114b07324b6216ac8e0f9df81e o die improvements to keep gpt-postinstall from croaking should an error occur. --- diff --git a/setup/setup-openssh.pl b/setup/setup-openssh.pl index 48bd208..b2e2362 100644 --- a/setup/setup-openssh.pl +++ b/setup/setup-openssh.pl @@ -24,7 +24,7 @@ $gptpath = $ENV{GPT_LOCATION}; $gpath = $ENV{GLOBUS_LOCATION}; if (!defined($gpath)) { - die "GLOBUS_LOCATION needs to be set before running this script" + exitDie "GLOBUS_LOCATION needs to be set before running this script" } # @@ -651,7 +651,8 @@ sub makeConfDir return; } - die("${sysconfdir} already exists and is not a directory!\n"); + print("${sysconfdir} already exists and is not a directory!\n"); + exit; } print "Could not find ${sysconfdir} directory... creating.\n"; @@ -1046,7 +1047,7 @@ sub readFile my($filename) = @_; my($data); - open(IN, "$filename") || die "Can't open '$filename': $!"; + open(IN, "$filename") || exitDie "Can't open '$filename': $!"; $/ = undef; $data = ; $/ = "\n"; @@ -1071,7 +1072,7 @@ sub writeFile if ( !defined($filename) || (length($filename) lt 1) ) { - die "Filename is undefined"; + exitDie "Filename is undefined"; } # @@ -1107,10 +1108,24 @@ sub action if (($result or $?) and $command !~ m!patch!) { - die "ERROR: Unable to execute command: $!\n"; + exitDie "ERROR: Unable to execute command: $!\n"; } } +### exitDie( $error ) +# +# a horribly named method meant to look like die but only exit, thereby not causing +# gpt-postinstall to croak. +# + +sub exitDie +{ + my($error) = @_; + + print $error; + exit; +} + ### query_boolean( $query_text, $default ) # # query the user with a string, and expect a response. If the user hits