From b6096ac7252ac9ff9a11b88e7404f198eb32b2c8 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 30 Jan 2009 10:36:18 +0000 Subject: (_filter_packages) split it out of _installTransactionClosure() --- perl-install/install/pkgs.pm | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm index 7bb66627e..7b2937c16 100644 --- a/perl-install/install/pkgs.pm +++ b/perl-install/install/pkgs.pm @@ -645,6 +645,22 @@ sub selectPackagesToUpgrade { log::l("finally selected pkgs: ", join(" ", sort map { $_->name } grep { $_->flag_selected } @{$packages->{depslist}})); } +sub _filter_packages { + my ($retry, $packages, @packages) = @_; + grep { + if ($_->flag_installed || !packageMedium($packages, $_)->{selected}) { + if ($_->name eq 'mdv-rpm-summary' && $_->flag_installed) { + install::pkgs::setup_rpm_summary_translations(); + } + $_->free_header; + 0; + } else { + log::l("failed to install " . $_->fullname . " (will retry)") if !$retry; + 1; + } + } @packages; +} + sub _installTransactionClosure { my ($packages, $id2pkg, $isUpgrade) = @_; @@ -785,18 +801,7 @@ sub install { _install_raw($packages, [ $retry ? $retry_pkg : @transToInstall ], $isUpgrade, $callback, $LOG, $retry_pkg); - @transToInstall = grep { - if ($_->flag_installed || !packageMedium($packages, $_)->{selected}) { - if ($_->name eq 'mdv-rpm-summary' && $_->flag_installed) { - install::pkgs::setup_rpm_summary_translations(); - } - $_->free_header; - 0; - } else { - log::l("failed to install " . $_->fullname . " (will retry)") if !$retry; - 1; - } - } @transToInstall; + @transToInstall = _filter_packages($retry, $packages, @transToInstall); if (@transToInstall) { if (!$retry || $retry_pkg != $transToInstall[0]) { -- cgit v1.2.1