summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-09-03 17:29:30 +0000
committerThierry Vignaud <tv@mageia.org>2012-09-03 17:29:30 +0000
commita42538f666f524e51abdcf31f33deac8d78a3877 (patch)
tree3cb900f67b1d2c58d92ccc3f2d61cf806421db46 /perl-install/install
parent66dc3d5c248149a73f17015be709fb8f5ac77853 (diff)
downloaddrakx-a42538f666f524e51abdcf31f33deac8d78a3877.tar
drakx-a42538f666f524e51abdcf31f33deac8d78a3877.tar.gz
drakx-a42538f666f524e51abdcf31f33deac8d78a3877.tar.bz2
drakx-a42538f666f524e51abdcf31f33deac8d78a3877.tar.xz
drakx-a42538f666f524e51abdcf31f33deac8d78a3877.zip
(installPackages) prevent going further if some transactions failed (mga#7016)
(_install_raw,install) propagate exit code
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/NEWS2
-rw-r--r--perl-install/install/pkgs.pm4
-rw-r--r--perl-install/install/steps.pm4
3 files changed, 8 insertions, 2 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 29d5ffcb2..c520ed907 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,5 @@
+- prevent going further if some transactions failed (mga#7016)
+
Version 14.39 - 3 September 2012
- rely on stage1 for mounting /dev
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 620e26b99..0115cd016 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -774,7 +774,7 @@ sub install {
#- place (install::steps_gtk.pm,...).
$callback->($packages, user => undef, install => $nb, $total);
- _install_raw($packages, $isUpgrade, $callback, $LOG, 0);
+ my $exit_code = _install_raw($packages, $isUpgrade, $callback, $LOG, 0);
log::l("closing install.log file");
close $LOG;
@@ -785,6 +785,8 @@ sub install {
clean_rpmdb_shared_regions(); #- workaround librpm which is buggy when using librpm rooted and the just installed rooted library
fs::loopback::save_boot($loop_boot);
+
+ $exit_code;
}
sub _unselect_package {
diff --git a/perl-install/install/steps.pm b/perl-install/install/steps.pm
index d595888c9..748db7280 100644
--- a/perl-install/install/steps.pm
+++ b/perl-install/install/steps.pm
@@ -427,6 +427,7 @@ sub installPackages {
#- 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 @@ sub installPackages {
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.
}