summaryrefslogtreecommitdiffstats
path: root/urpmi
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-02-27 20:49:33 +0000
committerThierry Vignaud <tv@mageia.org>2012-02-27 20:49:33 +0000
commit5e8cc5185a12d7d46034c10b214a97b5b9b96eee (patch)
tree63c3175b3585803c36448cdc4f8f5b0ff2835a59 /urpmi
parent7ab7fd6abde2b107c3235d9054a0e5c6ceffc922 (diff)
downloadurpmi-5e8cc5185a12d7d46034c10b214a97b5b9b96eee.tar
urpmi-5e8cc5185a12d7d46034c10b214a97b5b9b96eee.tar.gz
urpmi-5e8cc5185a12d7d46034c10b214a97b5b9b96eee.tar.bz2
urpmi-5e8cc5185a12d7d46034c10b214a97b5b9b96eee.tar.xz
urpmi-5e8cc5185a12d7d46034c10b214a97b5b9b96eee.zip
fix urpmi failing silently and with exit status 0 when package
installation fails due to either conflicts (mdv#63072) or to unselecting package (inspirated by mdv, mdv#63940)
Diffstat (limited to 'urpmi')
-rwxr-xr-xurpmi12
1 files changed, 12 insertions, 0 deletions
diff --git a/urpmi b/urpmi
index 8fb1086a..bd1520b2 100755
--- a/urpmi
+++ b/urpmi
@@ -496,6 +496,9 @@ that are older than the installed ones:\n%s", $list);
$msg .= N("\nContinue installation anyway?");
$force || message_input_($msg . N(" (Y/n) "), boolean => 1) !~ /[$noexpr]/ or exit 17;
}
+ # Whatever option we selected, the overall installation should fail if some packages are unselected
+ $urpm::postponed_msg .= $msg . "\n";
+ $urpm::postponed_code = 17;
}
my @ask_unselect = urpm::select::unselected_packages($urpm, $state);
@@ -511,6 +514,9 @@ if (@ask_unselect) {
$msg .= N("\nContinue installation anyway?");
$force || message_input_($msg . N(" (Y/n) "), boolean => 1) !~ /[$noexpr]/ or exit 17;
}
+ # Whatever option we selected, the overall installation should fail if some packages are unselected
+ $urpm::postponed_msg .= $msg . "\n";
+ $urpm::postponed_code = 17;
}
if (my @conflicting_pkgs_msgs =
@@ -681,6 +687,9 @@ unless ($env) {
urpm::removable::try_umounting_removables($urpm);
}
+# Merge postponed exit code to the result of package installation.
+$exit_code ||= $urpm::postponed_code;
+
#- restart urpmi if needed, keep command line for that.
if ($restart_itself && !$exit_code) {
print N("restarting urpmi"), "\n";
@@ -707,4 +716,7 @@ if ($pid_err || $pid_out) {
close STDOUT;
}
+# Show postponed message before exiting
+print $urpm::postponed_msg if $urpm::postponed_code != 0;
+
exit($exit_code);