From 946bdb1085f8528b6857ca0f6fca82fe580a10fe Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 7 Sep 2007 19:32:16 +0000 Subject: create _ids_to_fullnames() and _ids_to_names() --- URPM/Resolve.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'URPM/Resolve.pm') diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 9face0b..066a644 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -829,7 +829,7 @@ sub resolve_requested__no_suggests { } if (@best == @l) { - $urpm->{debug_URPM}("promoting " . join(' ', map { scalar $urpm->{depslist}[$_]->fullname } @best) . " because of conflict above") if $urpm->{debug_URPM}; + $urpm->{debug_URPM}("promoting " . join(' ', _ids_to_fullnames($urpm, @best)) . " because of conflict above") if $urpm->{debug_URPM}; push @properties, map { +{ required => $_, promote => $n, psel => $pkg } } @best; } else { if ($options{keep}) { @@ -901,6 +901,16 @@ sub _id_to_name { $dep; } } +sub _ids_to_names { + my $urpm = shift; + + map { $urpm->{depslist}[$_]->name } @_; +} +sub _ids_to_fullnames { + my $urpm = shift; + + map { scalar $urpm->{depslist}[$_]->fullname } @_; +} sub _set_flag_installed_and_upgrade_if_no_newer { my ($db, $pkg) = @_; @@ -1411,7 +1421,7 @@ sub sorted_rpms_to_string { my ($urpm, @sorted) = @_; 'rpms sorted by dependance: ' . join(' ', map { - join('+', map { $urpm->{depslist}[$_]->name } @$_); + join('+', _ids_to_names($urpm, @$_)); } @sorted); } @@ -1463,14 +1473,14 @@ sub build_transaction_set { if (my @bad_remove = grep { !$state->{rejected}{$_}{removed} || $state->{rejected}{$_}{obsoleted} } @remove) { $urpm->{error}(sorted_rpms_to_string($urpm, @sorted)) if $urpm->{error}; - $urpm->{error}('transaction is too small: ' . join(' ', @bad_remove) . ' is rejected but it should not (current transaction: ' . join(' ', map { scalar $urpm->{depslist}[$_]->fullname } @upgrade) . ', requested: ' . join('+', map { scalar $urpm->{depslist}[$_]->fullname } @ids) . ')') if $urpm->{error}; + $urpm->{error}('transaction is too small: ' . join(' ', @bad_remove) . ' is rejected but it should not (current transaction: ' . join(' ', _ids_to_fullnames($urpm, @upgrade)) . ', requested: ' . join('+', _ids_to_fullnames($urpm, @ids)) . ')') if $urpm->{error}; $state->{transaction} = []; last; } $urpm->{debug_URPM}(sprintf('transaction valid: remove=%s update=%s', join(',', @remove), - join(',', map { $urpm->{depslist}[$_]->name } @upgrade))) if $urpm->{debug_URPM}; + join(',', _ids_to_names($urpm, @upgrade)))) if $urpm->{debug_URPM}; $examined{$_} = undef foreach @upgrade, @remove; push @{$state->{transaction}}, { upgrade => \@upgrade, remove => \@remove }; -- cgit v1.2.1