diff options
author | Thierry Vignaud <tv@mandriva.org> | 2009-02-23 16:27:43 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2009-02-23 16:27:43 +0000 |
commit | 5e8e3353360ede4bc62b695d98653df0a6c98643 (patch) | |
tree | 4967c7f3c57257d084ee07ad459402d98e558ae9 /Rpmdrake/pkg.pm | |
parent | 9c1ecfef1df954b3d0e4c4604c38cf06d6214b10 (diff) | |
download | rpmdrake-5e8e3353360ede4bc62b695d98653df0a6c98643.tar rpmdrake-5e8e3353360ede4bc62b695d98653df0a6c98643.tar.gz rpmdrake-5e8e3353360ede4bc62b695d98653df0a6c98643.tar.bz2 rpmdrake-5e8e3353360ede4bc62b695d98653df0a6c98643.tar.xz rpmdrake-5e8e3353360ede4bc62b695d98653df0a6c98643.zip |
(get_pkgs) simplify and optimize
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rw-r--r-- | Rpmdrake/pkg.pm | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 6eb44840..0bf3dcef 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -515,18 +515,15 @@ sub get_pkgs { foreach my $pkg_id ($medium->{start} .. $medium->{end}) { my $pkg = $urpm->{depslist}[$pkg_id]; $pkg->flag_upgrade or next; - my $selected = 0; my $name = urpm_name($pkg); - - if (member($name, @requested)) { - # selecting updates by default but skipped ones (MandrivaUpdate only): - $selected = member($name, @requested_strict); - push @updates, $name; - } - $all_pkgs{$name} = { selected => $selected, pkg => $pkg, - }; + $all_pkgs{$name} = { pkg => $pkg }; } } + @updates = @requested; + # selecting updates by default but skipped ones (MandrivaUpdate only): + foreach (@requested_strict) { + $all_pkgs{$_}{selected} = 1; + } $all_pkgs{$_}{pkg}->set_flag_installed foreach @installed_pkgs; |