aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/pkg.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-03-07 17:23:04 +0000
committerThierry Vignaud <tv@mandriva.org>2008-03-07 17:23:04 +0000
commite81e007c155c4caeee24b4fb4025f6ba803ecd0f (patch)
tree368dba94c56b0629097cfefc81d90991cace0cf8 /Rpmdrake/pkg.pm
parent8231025b6fcaa35f764151cb72665a53d87664be (diff)
downloadrpmdrake-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")
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rw-r--r--Rpmdrake/pkg.pm29
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;