summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-02-18 12:47:26 +0000
committerThierry Vignaud <tv@mandriva.org>2009-02-18 12:47:26 +0000
commitb4242b74f0148a252b13c9ebbd93c913aaf13ddc (patch)
tree3ff4264c81f9d281dbbd6197a0618a8c55e52ec8
parent09c538bdbcec3cfcea55924715593b712dea9292 (diff)
downloaddrakx-b4242b74f0148a252b13c9ebbd93c913aaf13ddc.tar
drakx-b4242b74f0148a252b13c9ebbd93c913aaf13ddc.tar.gz
drakx-b4242b74f0148a252b13c9ebbd93c913aaf13ddc.tar.bz2
drakx-b4242b74f0148a252b13c9ebbd93c913aaf13ddc.tar.xz
drakx-b4242b74f0148a252b13c9ebbd93c913aaf13ddc.zip
(_filter_packages) split it out of _installTransactionClosure()
-rw-r--r--perl-install/install/pkgs.pm29
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]) {