[Mageia-dev] [soft-commits] [5589] (installPackages) prevent going further if some transactions failed (mga#7016)

nicolas vigier boklm at mars-attacks.org
Tue Mar 5 01:22:55 CET 2013


On Mon, 03 Sep 2012, root at mageia.org wrote:

> Revision: 5589
> Author:   tv
> Date:     2012-09-03 19:29:30 +0200 (Mon, 03 Sep 2012)
> Log Message:
> -----------
> (installPackages) prevent going further if some transactions failed (mga#7016)
> 
> (_install_raw,install) propagate exit code
> 
> Modified Paths:
> --------------
>     drakx/trunk/perl-install/install/NEWS
>     drakx/trunk/perl-install/install/pkgs.pm
>     drakx/trunk/perl-install/install/steps.pm
> 

[..]

> Modified: drakx/trunk/perl-install/install/steps.pm
> ===================================================================
> --- drakx/trunk/perl-install/install/steps.pm	2012-09-03 17:29:27 UTC (rev 5588)
> +++ drakx/trunk/perl-install/install/steps.pm	2012-09-03 17:29:30 UTC (rev 5589)
> @@ -427,6 +427,7 @@
>      #- small transaction will be built based on this selection and depslist.
>      my @toInstall = install::pkgs::packagesToInstall($packages);
>  
> +    my $exit_code;
>      my $time = time();
>      { 
>  	local $ENV{DURING_INSTALL} = 1;
> @@ -434,13 +435,14 @@
>  	local $ENV{TMP} = '/tmp';
>  	local $ENV{HOME};
>  	local $packages->{options}{auto} = !$o_interactive;
> -	install::pkgs::install($o->{isUpgrade}, \@toInstall, $packages, \&installCallback);
> +	$exit_code = install::pkgs::install($o->{isUpgrade}, \@toInstall, $packages, \&installCallback);
>      }
>      any::writeandclean_ldsoconf($::prefix);
>  
>      log::l("Install took: ", formatTimeRaw(time() - $time));
>      run_program::rooted_or_die($::prefix, 'ldconfig') if !$o->{justdb};
>  
> +    $exit_code and die "Installation failed";
>      install::media::log_sizes();
>      scalar(@toInstall); #- return number of packages installed.
>  }

Shouldn't it be cdie instead of die ? So that the error can be catched
by steps_interactive::installPackages__handle_error.



More information about the Mageia-dev mailing list