diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-03-01 11:08:52 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-03-01 11:08:52 +0000 |
commit | f3f35cd7cfe0bfff456bfb8f58426d7f89bda31a (patch) | |
tree | 9bdae95f6f48c6aebe32d8e5824f271741ee2fce /Rpmdrake/pkg.pm | |
parent | a046bd511f0ee012d2b55dfa6bc3c518c8ef8db6 (diff) | |
download | rpmdrake-f3f35cd7cfe0bfff456bfb8f58426d7f89bda31a.tar rpmdrake-f3f35cd7cfe0bfff456bfb8f58426d7f89bda31a.tar.gz rpmdrake-f3f35cd7cfe0bfff456bfb8f58426d7f89bda31a.tar.bz2 rpmdrake-f3f35cd7cfe0bfff456bfb8f58426d7f89bda31a.tar.xz rpmdrake-f3f35cd7cfe0bfff456bfb8f58426d7f89bda31a.zip |
(get_pkgs) move better updated enumeration algo from MandrivaUpdate here
(thus fixing a crash in MandrivaUpdate & making rpmdrake displaying the same
update set)
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rwxr-xr-x | Rpmdrake/pkg.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index f5e83ff6..807bd6d4 100755 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -371,6 +371,10 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1); start => 0, end => $#{$urpm->{depslist}}, ); + my @requested = $probe_only_for_updates ? + sort map { urpm_name($_) } $urpm->resolve_requested($db, $state, $requested, callback_choices => \&callback_choices) + : sort map { urpm_name($_) } @{$urpm->{depslist}}[keys %$requested]; + if (!$probe_only_for_updates) { $urpm->compute_installed_flags($db); # TODO/FIXME: not for updates $urpm->{depslist}[$_]->set_flag_installed foreach keys %$requested; #- pretend it's installed @@ -387,8 +391,8 @@ Then, restart %s.", $rpmdrake::myname_update)), myexit(-1); $pkg->flag_upgrade or next; my $selected = 0; - if (member(pkg2medium($pkg, $urpm)->{name}, @updates_media_names) && $pkg->flag_installed) { # TODO/FIXME: for updates - any { $pkg->id >= $_->{start} && $pkg->id <= $_->{end} } @update_medias or next; + if (member(urpm_name($pkg), @requested)) { + #any { $pkg->id >= $_->{start} && $pkg->id <= $_->{end} } @update_medias or next; if ($::options{'pkg-sel'} || $::options{'pkg-nosel'}) { my $n = urpm_name($pkg); $pkg_sel{$n} || $pkg_nosel{$n} or next; |