aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-03-04 20:16:04 +0000
committerThierry Vignaud <tv@mandriva.org>2008-03-04 20:16:04 +0000
commit35d34cfa614d86e902b3a13057e8f1bc0881d65c (patch)
treebf228c7282e9b16fb6e0404ff1d796c4e34abb60
parent1686ebf681d733bceae28b0938d0c4f5191ed81a (diff)
downloadrpmdrake-35d34cfa614d86e902b3a13057e8f1bc0881d65c.tar
rpmdrake-35d34cfa614d86e902b3a13057e8f1bc0881d65c.tar.gz
rpmdrake-35d34cfa614d86e902b3a13057e8f1bc0881d65c.tar.bz2
rpmdrake-35d34cfa614d86e902b3a13057e8f1bc0881d65c.tar.xz
rpmdrake-35d34cfa614d86e902b3a13057e8f1bc0881d65c.zip
(get_pkgs) use more modern urpm::select::resolve_dependencies() API
instead of partially open-coding it, thus enabling further improvements
-rw-r--r--NEWS1
-rw-r--r--Rpmdrake/pkg.pm29
2 files changed, 17 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index 72983bc6..4d314036 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@
o don't want to force a device anymore
o handle new "cdrom://" type
- handle --test
+- reuse more urpmi code
Version 4.3.1 - Wed Feb 27 2008, Thierry Vignaud
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 1779ec18..ccb08620 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -403,22 +403,25 @@ 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 = sort map { urpm_name($_) } @{$urpm->{depslist}}[keys %$requested];
+ my @requested;
+
# list of pure updates (w/o those matching /etc/urpmi/skip.list but with their deps):
- my @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:
- push @requested, difference2(\@requested_strict, \@requested) if $probe_only_for_updates;
+ my @requested_strict;
+
+ urpm::select::resolve_dependencies(
+ $urpm, $state, $requested,
+ callback_choices => \&Rpmdrake::gui::callback_choices,
+ priority_upgrade => $urpm->{options}{'priority-upgrade'},
+ auto_select => 1,
+ 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($_) } @_ }
+ ),
+ );
if (!$probe_only_for_updates) {
$urpm->compute_installed_flags($db); # TODO/FIXME: not for updates