From 5e8e3353360ede4bc62b695d98653df0a6c98643 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 23 Feb 2009 16:27:43 +0000 Subject: (get_pkgs) simplify and optimize --- Rpmdrake/pkg.pm | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'Rpmdrake') 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; -- cgit v1.2.1