aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-07 19:32:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-07 19:32:16 +0000
commit946bdb1085f8528b6857ca0f6fca82fe580a10fe (patch)
tree3097cb86d3691791450687a47641c7aea5e542a8 /URPM
parent37abffd4d7bc1e78afb70534bbb8c8b67a42a2c0 (diff)
downloadperl-URPM-946bdb1085f8528b6857ca0f6fca82fe580a10fe.tar
perl-URPM-946bdb1085f8528b6857ca0f6fca82fe580a10fe.tar.gz
perl-URPM-946bdb1085f8528b6857ca0f6fca82fe580a10fe.tar.bz2
perl-URPM-946bdb1085f8528b6857ca0f6fca82fe580a10fe.tar.xz
perl-URPM-946bdb1085f8528b6857ca0f6fca82fe580a10fe.zip
create _ids_to_fullnames() and _ids_to_names()
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm18
1 files changed, 14 insertions, 4 deletions
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 };