diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-01-30 10:36:18 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-01-30 10:36:18 +0000 |
commit | b6096ac7252ac9ff9a11b88e7404f198eb32b2c8 (patch) | |
tree | a410dc7346483bded46dafb16ef222ed3f524bf1 | |
parent | 901836bfb94e97f8ee3c4dde70d8c7b545d8ec68 (diff) | |
download | drakx-b6096ac7252ac9ff9a11b88e7404f198eb32b2c8.tar drakx-b6096ac7252ac9ff9a11b88e7404f198eb32b2c8.tar.gz drakx-b6096ac7252ac9ff9a11b88e7404f198eb32b2c8.tar.bz2 drakx-b6096ac7252ac9ff9a11b88e7404f198eb32b2c8.tar.xz drakx-b6096ac7252ac9ff9a11b88e7404f198eb32b2c8.zip |
(_filter_packages) split it out of _installTransactionClosure()
-rw-r--r-- | perl-install/install/pkgs.pm | 29 |
1 files 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]) { |