diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-03-07 17:23:04 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-03-07 17:23:04 +0000 |
commit | e81e007c155c4caeee24b4fb4025f6ba803ecd0f (patch) | |
tree | 368dba94c56b0629097cfefc81d90991cace0cf8 | |
parent | 8231025b6fcaa35f764151cb72665a53d87664be (diff) | |
download | rpmdrake-e81e007c155c4caeee24b4fb4025f6ba803ecd0f.tar rpmdrake-e81e007c155c4caeee24b4fb4025f6ba803ecd0f.tar.gz rpmdrake-e81e007c155c4caeee24b4fb4025f6ba803ecd0f.tar.bz2 rpmdrake-e81e007c155c4caeee24b4fb4025f6ba803ecd0f.tar.xz rpmdrake-e81e007c155c4caeee24b4fb4025f6ba803ecd0f.zip |
(get_pkgs) basically revert r238520 on 2008-03-04 b/c pixel want to
keep urpm::select::resolve_dependencies() simple and split it into
smaller bits (reverting "(get_pkgs) use more modern
urpm::select::resolve_dependencies() API instead of partially
open-coding it, thus enabling further improvements")
-rw-r--r-- | Rpmdrake/pkg.pm | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 20dbe0f0..ebb6fba1 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -408,29 +408,22 @@ sub get_pkgs { my $requested = {}; my $state = {}; + $urpm->request_packages_to_upgrade( + $db, + $state, + $requested, + ); # list of updates (including those matching /etc/urpmi/skip.list): - my @requested; + my @requested = sort map { urpm_name($_) } @{$urpm->{depslist}}[keys %$requested]; # list of pure updates (w/o those matching /etc/urpmi/skip.list but with their deps): my @requested_strict; - - #- return value is true if program should be restarted (in order to take care of important - #- packages being upgraded (urpmi, perl-URPM, rpm, glibc, ...). - $restart_itself = urpm::select::resolve_dependencies( - $urpm, $state, $requested, - callback_choices => \&Rpmdrake::gui::callback_choices, - priority_upgrade => $urpm->{options}{'priority-upgrade'}, - auto_select => 1, - only_request_packages_to_upgrade => !$probe_only_for_updates, - upgrade_callback => sub { - @requested = sort map { urpm_name($_) } @{$urpm->{depslist}}[keys %$requested]; - }, - if_($probe_only_for_updates, - resolve_req_callback => sub { @requested_strict = sort map { urpm_name($_) } @_ } - ), - ); - + @requested_strict = $probe_only_for_updates ? + sort map { + urpm_name($_); + } $urpm->resolve_requested($db, $state, $requested, callback_choices => \&Rpmdrake::gui::callback_choices) + : (); # list updates including skiped ones + their deps in MandrivaUpdate: @requested = uniq(@requested, @requested_strict) if $probe_only_for_updates; |