Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11706 - main/trunk/pym/portage
Date: Mon, 20 Oct 2008 19:11:18
Message-Id: E1Ks09s-0003Z5-Cd@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-10-20 19:11:15 +0000 (Mon, 20 Oct 2008)
3 New Revision: 11706
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 Log:
8 Prefer thirdpartymirrors over normal mirrors in cases when the file does not
9 yet exist on the normal mirrors. Thanks to Maurice van der Pot <griffon26@g.o>
10 for reporting.
11
12
13 Modified: main/trunk/pym/portage/__init__.py
14 ===================================================================
15 --- main/trunk/pym/portage/__init__.py 2008-10-20 18:21:42 UTC (rev 11705)
16 +++ main/trunk/pym/portage/__init__.py 2008-10-20 19:11:15 UTC (rev 11706)
17 @@ -3494,6 +3494,7 @@
18 filedict={}
19 primaryuri_indexes={}
20 primaryuri_dict = {}
21 + thirdpartymirror_uris = {}
22 for myfile, myuri in file_uri_tuples:
23 if myfile not in filedict:
24 filedict[myfile]=[]
25 @@ -3517,9 +3518,10 @@
26 if mirrorname in thirdpartymirrors:
27 shuffle(thirdpartymirrors[mirrorname])
28
29 - for locmirr in thirdpartymirrors[mirrorname]:
30 - filedict[myfile].append(
31 - locmirr.rstrip("/") + "/" + path)
32 + uris = [locmirr.rstrip("/") + "/" + path \
33 + for locmirr in thirdpartymirrors[mirrorname]]
34 + filedict[myfile].extend(uris)
35 + thirdpartymirror_uris.setdefault(myfile, []).extend(uris)
36
37 if not filedict[myfile]:
38 writemsg("No known mirror by the name: %s\n" % (mirrorname))
39 @@ -3545,6 +3547,11 @@
40 primaryuri_dict[myfile] = primaryuris
41 primaryuris.append(myuri)
42
43 + # Prefer thirdpartymirrors over normal mirrors in cases when
44 + # the file does not yet exist on the normal mirrors.
45 + for myfile, uris in thirdpartymirror_uris.iteritems():
46 + primaryuri_dict.setdefault(myfile, []).extend(uris)
47 +
48 can_fetch=True
49
50 if listonly: