diff options
author | Tim Retout <tim@retout.co.uk> | 2012-09-17 23:23:09 +0100 |
---|---|---|
committer | Tim Retout <tim@retout.co.uk> | 2012-09-17 23:31:31 +0100 |
commit | b6e33e2322cae87f450237273fe9a8e42806e107 (patch) | |
tree | 1989ed55d7618f53637bb1e28ac433829518201a /solenv | |
parent | 3ce06f2dc80cbe7858721d4617a761f71f59c0db (diff) |
installer: wrap main function with error handling.
Change-Id: Idca4dab27644e2c30a6c0a7549021c59fd99bc3a
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/make_installer.pl | 2 | ||||
-rw-r--r-- | solenv/bin/modules/installer.pm | 33 |
2 files changed, 14 insertions, 21 deletions
diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl index a684dcd69837..eef41726d7ad 100644 --- a/solenv/bin/make_installer.pl +++ b/solenv/bin/make_installer.pl @@ -32,4 +32,4 @@ use lib ("$ENV{SOLARENV}/bin/modules"); use installer qw(main); -main(); +exit main(); diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index c78225e24580..71bc3c513199 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -87,25 +87,24 @@ use installer::ziplist; our @EXPORT_OK = qw(main); sub main { - ################################################# - # Main program - ################################################# + installer::logger::starttime(); - ################################################# - # Part 1: The platform independent part - ################################################# + my $exit_code = 0; - ################################################# - # Part 1a: The language independent part - ################################################# + eval { + run(); + }; + if ($@) { + warn "$@\n"; + $exit_code = -1; + } - installer::logger::starttime(); + installer::logger::stoptime(); - ######################################### - # Checking the environment and setting - # most important variables - ######################################### + return $exit_code; +} +sub run { installer::logger::print_message( "... checking environment variables ...\n" ); my $environmentvariableshashref = installer::control::check_system_environment(); @@ -1822,12 +1821,6 @@ sub main { print $log_fh Dumper($filesinproductlanguageresolvedarrayref); } # end of iteration for one language group - - ####################################################### - # Stopping time - ####################################################### - - installer::logger::stoptime(); } 1; |