From 58530494f87ece91bf498453c5fb6778a2f69a00 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 20 Oct 2008 19:11:15 +0000 Subject: Prefer thirdpartymirrors over normal mirrors in cases when the file does not yet exist on the normal mirrors. Thanks to Maurice van der Pot for reporting. svn path=/main/trunk/; revision=11706 --- pym/portage/__init__.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index d13c2f7fb..dfc332f65 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -3494,6 +3494,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", filedict={} primaryuri_indexes={} primaryuri_dict = {} + thirdpartymirror_uris = {} for myfile, myuri in file_uri_tuples: if myfile not in filedict: filedict[myfile]=[] @@ -3517,9 +3518,10 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", if mirrorname in thirdpartymirrors: shuffle(thirdpartymirrors[mirrorname]) - for locmirr in thirdpartymirrors[mirrorname]: - filedict[myfile].append( - locmirr.rstrip("/") + "/" + path) + uris = [locmirr.rstrip("/") + "/" + path \ + for locmirr in thirdpartymirrors[mirrorname]] + filedict[myfile].extend(uris) + thirdpartymirror_uris.setdefault(myfile, []).extend(uris) if not filedict[myfile]: writemsg("No known mirror by the name: %s\n" % (mirrorname)) @@ -3545,6 +3547,11 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", primaryuri_dict[myfile] = primaryuris primaryuris.append(myuri) + # Prefer thirdpartymirrors over normal mirrors in cases when + # the file does not yet exist on the normal mirrors. + for myfile, uris in thirdpartymirror_uris.iteritems(): + primaryuri_dict.setdefault(myfile, []).extend(uris) + can_fetch=True if listonly: -- cgit v1.2.3-1-g7c22