From b4f41fd76052d050918645abd66a4cbc493b78e6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 24 Sep 2008 19:09:07 +0000 Subject: Fix fetch() mirror:// handling in to comply with section 9.2.8 of PMS. svn path=/main/trunk/; revision=11537 --- pym/portage/__init__.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 4e88931d7..dcd399f24 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -3508,11 +3508,19 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", eidx = myuri.find("/", 9) if eidx != -1: mirrorname = myuri[9:eidx] + if myfile != os.path.basename(myuri): + # If a SRC_URI arrow is used together with + # mirror://, preserve the remote path that's + # specified within the uri. + path = myuri[eidx+1:] + else: + path = myfile # Try user-defined mirrors first if mirrorname in custommirrors: for cmirr in custommirrors[mirrorname]: - filedict[myfile].append(cmirr+"/"+myuri[eidx+1:]) + filedict[myfile].append( + cmirr.rstrip("/") + "/" + path) # remove the mirrors we tried from the list of official mirrors if cmirr.strip() in thirdpartymirrors[mirrorname]: thirdpartymirrors[mirrorname].remove(cmirr) @@ -3521,7 +3529,8 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", shuffle(thirdpartymirrors[mirrorname]) for locmirr in thirdpartymirrors[mirrorname]: - filedict[myfile].append(locmirr+"/"+myuri[eidx+1:]) + filedict[myfile].append( + locmirr.rstrip("/") + "/" + path) if not filedict[myfile]: writemsg("No known mirror by the name: %s\n" % (mirrorname)) -- cgit v1.2.3-1-g7c22