From 488775499aa8603c9b2c8a444d22072b293ce16f Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 13 Oct 2008 23:26:31 +0000 Subject: (run_gurpmi,upgrade) run up to 4 gurpmi passes if needed --- mdkapplet-upgrade-helper | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mdkapplet-upgrade-helper b/mdkapplet-upgrade-helper index d0f91f73..6a7d57f7 100755 --- a/mdkapplet-upgrade-helper +++ b/mdkapplet-upgrade-helper @@ -62,12 +62,16 @@ my ($refork_gurpmi); sub run_gurpmi() { + my @initial_args = '--replacefiles'; while ($refork_gurpmi) { + fork_gurpmi(@initial_args); + undef @initial_args; my $status = $? >> 8; if ($refork_gurpmi && $status) { - fork_gurpmi(); + $refork_gurpmi--; + } else { + undef $refork_gurpmi; } - undef $refork_gurpmi; if ($status) { ugtk2::ask_warn(N("Error"), N("Installation failed"), @@ -133,7 +137,7 @@ sub upgrade() { log::explanations("upgrading urpmi and rpmdrake"); log::explanations("upgrading the whole system"); # rerun gurpmi in case there was an issue (with eg: big transactions: - $refork_gurpmi = 1; + $refork_gurpmi = 4; { # force PATH: local $ENV{TMPDIR} = undef; @@ -141,7 +145,7 @@ sub upgrade() { } # we cannot use installUpdates() as MandrivaUpdate needs the media # flaged as update (or else, we need to add a new option to MandrivaUpdate): - fork_gurpmi('--replacefiles'); + run_gurpmi(); } sub fork_gurpmi { -- cgit v1.2.1