summaryrefslogtreecommitdiffstats
path: root/pym/portage/__init__.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-10-20 19:11:15 +0000
committerZac Medico <zmedico@gentoo.org>2008-10-20 19:11:15 +0000
commit58530494f87ece91bf498453c5fb6778a2f69a00 (patch)
treeb5cabf9ee9cd3e0b4ef3c98264987bffd2818d02 /pym/portage/__init__.py
parent707e77d45f3f2b57a2576d158af4265785896c80 (diff)
downloadportage-58530494f87ece91bf498453c5fb6778a2f69a00.tar.gz
portage-58530494f87ece91bf498453c5fb6778a2f69a00.tar.bz2
portage-58530494f87ece91bf498453c5fb6778a2f69a00.zip
Prefer thirdpartymirrors over normal mirrors in cases when the file does not
yet exist on the normal mirrors. Thanks to Maurice van der Pot <griffon26@g.o> for reporting. svn path=/main/trunk/; revision=11706
Diffstat (limited to 'pym/portage/__init__.py')
-rw-r--r--pym/portage/__init__.py13
1 files 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: