diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-07-27 09:08:26 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-07-27 09:08:26 +0000 |
commit | 19196ed7f03e2de25b72c13f5117de53c14bec49 (patch) | |
tree | 34e144e5699c00b50e0f2ae1ca8041b655e3c9bc | |
parent | 77c4f8446ab30751957d22d00a3fe7831ad0084f (diff) | |
download | rpmdrake-19196ed7f03e2de25b72c13f5117de53c14bec49.tar rpmdrake-19196ed7f03e2de25b72c13f5117de53c14bec49.tar.gz rpmdrake-19196ed7f03e2de25b72c13f5117de53c14bec49.tar.bz2 rpmdrake-19196ed7f03e2de25b72c13f5117de53c14bec49.tar.xz rpmdrake-19196ed7f03e2de25b72c13f5117de53c14bec49.zip |
A slight optimisation
-rwxr-xr-x | rpmdrake | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1318,6 +1318,9 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1); ); $urpm->{depslist}[$_]->set_flag_installed foreach keys %$requested; #- pretend it's installed + my %pkg_sel = map { $_ => 1 } @{$options{'pkg-sel'} || []}; + my %pkg_nosel = map { $_ => 1 } @{$options{'pkg-nosel'} || []}; + use Data::Dumper;warn Dumper \%pkg_sel; foreach my $pkg (@{$urpm->{depslist}}) { $pkg->flag_upgrade or next; my $selected = 0; @@ -1325,10 +1328,9 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1); $pkg->flag_installed or next; any { $pkg->id >= $_->{start} && $pkg->id <= $_->{end} } @update_medias or next; if ($options{'pkg-sel'} || $options{'pkg-nosel'}) { - if ($#{$options{'pkg-sel'}} != -1 || $#{$options{'pkg-nosel'}} != -1) { - member(urpm_name($pkg), @{$options{'pkg-sel'}}, @{$options{'pkg-nosel'}}) or next; - member(urpm_name($pkg), @{$options{'pkg-sel'}}) and $selected = 1; - } + my $n = urpm_name($pkg); + $pkg_sel{$n} || $pkg_nosel{$n} or next; + $pkg_sel{$n} and $selected = 1; } } $installable_pkgs{my_fullname($pkg)} = { selected => $selected, pkg => $pkg }; |