aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--URPM/Resolve.pm9
2 files changed, 10 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index ac8f1ae..f9e90f2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- prevent urpmi from looping forever when some packages are broken
+
Version 4.15.1 - 11 October 2012
- drop support for repackage (non working since rpm-4.6 in 2009)
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.