From 88cca699e7dffa487c2382293dd97f6efbeca97a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 16 Nov 2012 20:18:27 +0000 Subject: (resolve_requested__no_suggests_) prevent urpmi from looping forever when some packages are broken alternatively, we could try detecting if diff_provides doesn't change for a couple loops or not going over already rejected packages (selecting/promoting/rejecting the same package forever) eg: gtk+3.0-3.6.1-3.mga3.x86_64 is on the mirrors but not lib64gtk+3_0-3.6.1-3.mga3.x86_64 we will then loop forever: set_rejected: gtk+3.0-3.6.1-2.mga3.x86_64 installed lib64gtk+3_0-3.6.1-2.mga3.x86_64 is conflicting because of unsatisfied gtk+3.0[== 3.6.1-2.mga3] gtk+3.0[*][== 3.6.1-2.mga3] set_rejected: lib64gtk+3_0-3.6.1-2.mga3.x86_64 installed lib64gtk+3.0-devel-3.6.1-2.mga3.x86_64 is conflicting because of unsatisfied lib64gtk+3_0[== 3.6.1] set_rejected: lib64gtk+3.0-devel-3.6.1-2.mga3.x86_64 installed lib64gtk-gir3.0-3.6.1-2.mga3.x86_64 is conflicting because of unsatisfied lib64gtk+3_0[== 3.6.1-2.mga3] set_rejected: lib64gtk-gir3.0-3.6.1-2.mga3.x86_64 installed gtk+3.0-3.6.1-2.mga3.x86_64 is conflicting because of unsatisfied lib64gtk+3_0[== 3.6.1] promoting gtk+3.0-3.6.1-3.mga3.x86_64 because of conflict above unselecting gtk+3.0-3.6.1-3.mga3.x86_64 set_rejected: gtk+3.0-3.6.1-2.mga3.x86_64 (...) --- URPM/Resolve.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'URPM') diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 16aaf0e..a2827eb 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -967,6 +967,7 @@ sub resolve_requested__no_suggests_ { #- then examine provides that will be removed (which need to be satisfied by another #- package present or by a new package to upgrade), then requires not satisfied and #- finally conflicts that will force a new upgrade or a remove. + my $count = 1; do { while (my $dep = shift @properties) { #- we need to avoid selecting packages if the source has been disabled. @@ -1054,7 +1055,13 @@ sub resolve_requested__no_suggests_ { } elsif (my $dep = shift @choices) { push @properties, $dep; } - } while @diff_provides || @properties || @choices; + + # safety: + if ($count++ > 1000) { + die("detecting looping forever while trying to resolve dependancies.\n" + . "Aborting... Try again with '-vv --debug' options"); + } + } while (@diff_provides || @properties || @choices); #- return what has been selected by this call (not all selected hash which may be not empty #- previously. avoid returning rejected packages which weren't selectable. -- cgit v1.2.1