aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-11-16 20:18:27 +0000
committerThierry Vignaud <tv@mageia.org>2012-11-16 20:18:27 +0000
commit88cca699e7dffa487c2382293dd97f6efbeca97a (patch)
tree78a52ca6c506335f28fd7caa5ae69043592474a7 /URPM
parent494d762dd4e027965257abbf90339d7f7e330e8c (diff)
downloadperl-URPM-88cca699e7dffa487c2382293dd97f6efbeca97a.tar
perl-URPM-88cca699e7dffa487c2382293dd97f6efbeca97a.tar.gz
perl-URPM-88cca699e7dffa487c2382293dd97f6efbeca97a.tar.bz2
perl-URPM-88cca699e7dffa487c2382293dd97f6efbeca97a.tar.xz
perl-URPM-88cca699e7dffa487c2382293dd97f6efbeca97a.zip
(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 (...)
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm9
1 files changed, 8 insertions, 1 deletions
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.