1 |
Author: zmedico |
2 |
Date: 2008-09-24 19:09:07 +0000 (Wed, 24 Sep 2008) |
3 |
New Revision: 11537 |
4 |
|
5 |
Modified: |
6 |
main/trunk/pym/portage/__init__.py |
7 |
Log: |
8 |
Fix fetch() mirror:// handling in to comply with section 9.2.8 of PMS. |
9 |
|
10 |
|
11 |
Modified: main/trunk/pym/portage/__init__.py |
12 |
=================================================================== |
13 |
--- main/trunk/pym/portage/__init__.py 2008-09-23 20:04:09 UTC (rev 11536) |
14 |
+++ main/trunk/pym/portage/__init__.py 2008-09-24 19:09:07 UTC (rev 11537) |
15 |
@@ -3508,11 +3508,19 @@ |
16 |
eidx = myuri.find("/", 9) |
17 |
if eidx != -1: |
18 |
mirrorname = myuri[9:eidx] |
19 |
+ if myfile != os.path.basename(myuri): |
20 |
+ # If a SRC_URI arrow is used together with |
21 |
+ # mirror://, preserve the remote path that's |
22 |
+ # specified within the uri. |
23 |
+ path = myuri[eidx+1:] |
24 |
+ else: |
25 |
+ path = myfile |
26 |
|
27 |
# Try user-defined mirrors first |
28 |
if mirrorname in custommirrors: |
29 |
for cmirr in custommirrors[mirrorname]: |
30 |
- filedict[myfile].append(cmirr+"/"+myuri[eidx+1:]) |
31 |
+ filedict[myfile].append( |
32 |
+ cmirr.rstrip("/") + "/" + path) |
33 |
# remove the mirrors we tried from the list of official mirrors |
34 |
if cmirr.strip() in thirdpartymirrors[mirrorname]: |
35 |
thirdpartymirrors[mirrorname].remove(cmirr) |
36 |
@@ -3521,7 +3529,8 @@ |
37 |
shuffle(thirdpartymirrors[mirrorname]) |
38 |
|
39 |
for locmirr in thirdpartymirrors[mirrorname]: |
40 |
- filedict[myfile].append(locmirr+"/"+myuri[eidx+1:]) |
41 |
+ filedict[myfile].append( |
42 |
+ locmirr.rstrip("/") + "/" + path) |
43 |
|
44 |
if not filedict[myfile]: |
45 |
writemsg("No known mirror by the name: %s\n" % (mirrorname)) |