aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-28 14:12:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-28 14:12:04 +0000
commitd2b7669d9af31fafd7d5ccc2764c772c47abbb44 (patch)
tree8ff5a0d7c124d760b85ca292a58d81567647ed86 /URPM
parent0678faa5b893133be664ac18c522200501e7f021 (diff)
downloadperl-URPM-d2b7669d9af31fafd7d5ccc2764c772c47abbb44.tar
perl-URPM-d2b7669d9af31fafd7d5ccc2764c772c47abbb44.tar.gz
perl-URPM-d2b7669d9af31fafd7d5ccc2764c772c47abbb44.tar.bz2
perl-URPM-d2b7669d9af31fafd7d5ccc2764c772c47abbb44.tar.xz
perl-URPM-d2b7669d9af31fafd7d5ccc2764c772c47abbb44.zip
ensure #31969 doesn't occur anymore. if somethings goes wrong:
- display error message - then default to one big transaction also display error message "using one big transaction" in the old check (which i don't really know what it does)
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm22
1 files changed, 17 insertions, 5 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 64e8016..27d2419 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -1329,13 +1329,15 @@ sub sort_by_dependencies {
_sort_by_dependencies__add_obsolete_edges($urpm, $state, \@list_unsorted, $requires);
- my @sorted = sort_graph(\@list_unsorted, $requires);
+ sort_graph(\@list_unsorted, $requires);
+}
- $urpm->{debug_URPM}('rpms sorted by dependance: ' . join(' ', map {
- join('+', map { $urpm->{depslist}[$_]->name } @$_);
- } @sorted)) if $urpm->{debug_URPM};
+sub sorted_rpms_to_string {
+ my ($urpm, @sorted) = @_;
- @sorted;
+ 'rpms sorted by dependance: ' . join(' ', map {
+ join('+', map { $urpm->{depslist}[$_]->name } @$_);
+ } @sorted);
}
#- build transaction set for given selection
@@ -1354,6 +1356,7 @@ sub build_transaction_set {
keys(%selected_id) > 0 ?
(grep { exists($selected_id{$_}) } keys %{$state->{selected}}) :
keys %{$state->{selected}});
+ $urpm->{debug_URPM}(sorted_rpms_to_string($urpm, @sorted)) if $urpm->{debug_URPM};
#- second step consists of re-applying resolve_requested in the same
#- order computed in first step and to update a list of packages to
@@ -1382,6 +1385,13 @@ sub build_transaction_set {
@upgrade || @remove or next;
+ 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 { $urpm->{depslist}[$_]->name } @upgrade) . ')') 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};
@@ -1399,11 +1409,13 @@ sub build_transaction_set {
) {
foreach (keys(%{$state->{selected}})) {
exists $state->{transaction_state}{selected}{$_} and next;
+ $urpm->{error}('using one big transaction') if $urpm->{error};
$state->{transaction} = []; last;
}
foreach (grep { $state->{rejected}{$_}{removed} && !$state->{rejected}{$_}{obsoleted} } keys %{$state->{rejected}}) {
$state->{transaction_state}{rejected}{$_}{removed} &&
!$state->{transaction_state}{rejected}{$_}{obsoleted} and next;
+ $urpm->{error}('using one big transaction') if $urpm->{error};
$state->{transaction} = []; last;
}
}