FetchTask: avoid possible duplicate URI
authorZac Medico <zmedico@gentoo.org>
Thu, 10 Jan 2013 09:17:46 +0000 (01:17 -0800)
committerZac Medico <zmedico@gentoo.org>
Thu, 10 Jan 2013 09:17:46 +0000 (01:17 -0800)
pym/portage/_emirrordist/FetchTask.py

index 50e4242896a0a46c2b88d11ed2a6f5e522e42af0..107db56d4af96c30c143163cc59528477c1a2a66 100644 (file)
@@ -255,8 +255,10 @@ class FetchTask(CompositeTask):
                                        if uri not in self._tried_uris:
                                                return uri
 
-                       if self._primaryuri_stack:
-                               return self._primaryuri_stack.pop()
+                       while self._primaryuri_stack:
+                               uri = self._primaryuri_stack.pop()
+                               if uri not in self._tried_uris:
+                                       return uri
 
                return None