solenv/bin/make_installer.pl | 2 - solenv/bin/modules/installer.pm | 33 ++++++++++++-------------------- solenv/bin/modules/installer/control.pm | 18 +++++++++++------ solenv/bin/modules/installer/globals.pm | 1 4 files changed, 26 insertions(+), 28 deletions(-)
New commits: commit b6e33e2322cae87f450237273fe9a8e42806e107 Author: Tim Retout <t...@retout.co.uk> Date: Mon Sep 17 23:23:09 2012 +0100 installer: wrap main function with error handling. Change-Id: Idca4dab27644e2c30a6c0a7549021c59fd99bc3a diff --git a/solenv/bin/make_installer.pl b/solenv/bin/make_installer.pl index a684dcd..eef4172 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 c78225e..71bc3c5 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; commit 3ce06f2dc80cbe7858721d4617a761f71f59c0db Author: Tim Retout <t...@retout.co.uk> Date: Wed Sep 5 08:37:57 2012 +0100 installer: Inline @installer::globals::environmentvariables Change-Id: I9aab3ec39b833dac242b9ede21ac3f2e5eb78200 diff --git a/solenv/bin/modules/installer/control.pm b/solenv/bin/modules/installer/control.pm index bbb613a..7975bd9 100644 --- a/solenv/bin/modules/installer/control.pm +++ b/solenv/bin/modules/installer/control.pm @@ -271,16 +271,22 @@ sub check_makecab_version sub check_system_environment { my %variables = (); - my $key; my $error = 0; - foreach $key ( @installer::globals::environmentvariables ) + my @environmentvariables = qw( + SOLARVERSION + GUI + WORK_STAMP + OUTPATH + LOCAL_OUT + LOCAL_COMMON_OUT + ); + + for my $key ( @environmentvariables ) { - my $value = ""; - if ( $ENV{$key} ) { $value = $ENV{$key}; } - $variables{$key} = $value; + $variables{$key} = $ENV{$key} || ""; - if ( $value eq "" ) + if ( $variables{$key} eq "" ) { installer::logger::print_error( "$key not set in environment\n" ); $error = 1; diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index bee3d0d..c99af76 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -263,7 +263,6 @@ BEGIN @solarispatchscripts = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall", "postinstall", "preinstall", "i.none"); @solarispatchscriptsforextensions = ("checkinstall", "copyright", "patch_checkinstall", "patch_postinstall_extensions", "postinstall_extensions", "preinstall", "i.none"); @solarispatchfiles = (".diPatch", "patchinfo"); - @environmentvariables = ( "SOLARVERSION", "GUI", "WORK_STAMP", "OUTPATH", "LOCAL_OUT", "LOCAL_COMMON_OUT" ); @packagelistitems = ("module", "solarispackagename", "packagename", "copyright", "vendor", "description" ); @languagepackfeature =(); @helppackfeature =(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits