aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-12 11:00:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-12 11:00:38 +0000
commitac7b49244a43a9a46ae68935aa239a03ce092f77 (patch)
treedd46187a8a8e75c757fd0be3a50927a9b43c04e0 /URPM
parentf6501c4b6d7b8c6f0194d4816f87809651aa8a53 (diff)
downloadperl-URPM-ac7b49244a43a9a46ae68935aa239a03ce092f77.tar
perl-URPM-ac7b49244a43a9a46ae68935aa239a03ce092f77.tar.gz
perl-URPM-ac7b49244a43a9a46ae68935aa239a03ce092f77.tar.bz2
perl-URPM-ac7b49244a43a9a46ae68935aa239a03ce092f77.tar.xz
perl-URPM-ac7b49244a43a9a46ae68935aa239a03ce092f77.zip
create _dep_to_name() and use it
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index bd7a977..1733b5f 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -250,12 +250,12 @@ sub _choose_required {
#- packages. If multiple packages are possible, simply ask the user which
#- one to choose; else take the first one available.
if (!@$chosen) {
- $urpm->{debug_URPM}("no packages match " . _id_to_name($urpm, $dep->{required}) . " (it may be in skip.list)") if $urpm->{debug_URPM};
+ $urpm->{debug_URPM}("no packages match " . _dep_to_name($urpm, $dep) . " (it may be in skip.list)") if $urpm->{debug_URPM};
unshift @$properties, backtrack_selected($urpm, $db, $state, $dep, %options);
return; #- backtrack code choose to continue with same package or completely new strategy.
} elsif ($options{callback_choices} && @$chosen > 1) {
- my @l = grep { ref $_ } $options{callback_choices}->($urpm, $db, $state, $chosen, _id_to_name($urpm, $dep->{required}), $prefered);
- $urpm->{debug_URPM}("replacing " . _id_to_name($urpm, $dep->{required}) . " with " .
+ my @l = grep { ref $_ } $options{callback_choices}->($urpm, $db, $state, $chosen, _dep_to_name($urpm, $dep), $prefered);
+ $urpm->{debug_URPM}("replacing " . _dep_to_name($urpm, $dep) . " with " .
join(' ', map { $_->name } @l)) if $urpm->{debug_URPM};
unshift @$properties, map {
+{
@@ -270,8 +270,8 @@ sub _choose_required {
#- now do the real work, select the package.
my $pkg = shift @$chosen;
- if ($urpm->{debug_URPM} && $pkg->name ne _id_to_name($urpm, $dep->{required})) {
- $urpm->{debug_URPM}("chosen " . $pkg->fullname . " for " . _id_to_name($urpm, $dep->{required}));
+ if ($urpm->{debug_URPM} && $pkg->name ne _dep_to_name($urpm, $dep)) {
+ $urpm->{debug_URPM}("chosen " . $pkg->fullname . " for " . _dep_to_name($urpm, $dep));
@$chosen and $urpm->{debug_URPM}(" (it could also have chosen " . join(' ', map { scalar $_->fullname } @$chosen));
}
@@ -984,6 +984,11 @@ sub _handle_provides_overlap {
}
#- side-effects: none
+sub _dep_to_name {
+ my ($urpm, $dep) = @_;
+ _id_to_name($urpm, $dep->{required});
+}
+#- side-effects: none
sub _id_to_name {
my ($urpm, $id_prop) = @_;
if ($id_prop =~ /^\d+/) {