diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-02-23 16:36:31 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-02-23 16:36:31 +0000 |
commit | 077da458efeb27b2e77518eefcb94621a3608214 (patch) | |
tree | ae0d40bd3fdcf835f2b2cf6436ab9f8667bb08f1 /Rpmdrake | |
parent | 5e8e3353360ede4bc62b695d98653df0a6c98643 (diff) | |
download | rpmdrake-077da458efeb27b2e77518eefcb94621a3608214.tar rpmdrake-077da458efeb27b2e77518eefcb94621a3608214.tar.gz rpmdrake-077da458efeb27b2e77518eefcb94621a3608214.tar.bz2 rpmdrake-077da458efeb27b2e77518eefcb94621a3608214.tar.xz rpmdrake-077da458efeb27b2e77518eefcb94621a3608214.zip |
(get_updates_list,get_pkgs) latest simplification commit enables to further simplify, thus removing a useless loop on update media
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/pkg.pm | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 0bf3dcef..10d7fe2f 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -353,7 +353,7 @@ our $need_restart; our $probe_only_for_updates; sub get_updates_list { - my ($urpm, $db, $state, $requested, $requested_list, $requested_strict) = @_; + my ($urpm, $db, $state, $requested, $requested_list, $requested_strict, $all_pkgs) = @_; $urpm->request_packages_to_upgrade( $db, @@ -373,7 +373,11 @@ sub get_updates_list { } # list of updates (including those matching /etc/urpmi/skip.list): - @$requested_list = sort map { urpm_name($_) } @{$urpm->{depslist}}[keys %$requested]; + @$requested_list = sort map { + my $name = urpm_name($_); + $all_pkgs->{$name} = { pkg => $_ }; + $name; + } @{$urpm->{depslist}}[keys %$requested]; # list of pure updates (w/o those matching /etc/urpmi/skip.list but with their deps): if ($probe_only_for_updates && !$need_restart) { @@ -475,7 +479,7 @@ sub get_pkgs { my (@requested, @requested_strict); if ($::rpmdrake_options{compute_updates} || $::MODE eq 'update') { - get_updates_list($urpm, $db, $state, $requested, \@requested, \@requested_strict); + get_updates_list($urpm, $db, $state, $requested, \@requested, \@requested_strict, \%all_pkgs); } $priority_state = $need_restart ? $state : undef; @@ -510,15 +514,6 @@ sub get_pkgs { $all_pkgs{$name} = { pkg => $pkg }; } } - foreach my $medium (@update_medias) { - update_pbar($gurpm); - foreach my $pkg_id ($medium->{start} .. $medium->{end}) { - my $pkg = $urpm->{depslist}[$pkg_id]; - $pkg->flag_upgrade or next; - my $name = urpm_name($pkg); - $all_pkgs{$name} = { pkg => $pkg }; - } - } @updates = @requested; # selecting updates by default but skipped ones (MandrivaUpdate only): foreach (@requested_strict) { |