diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-09-24 19:09:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-09-24 19:09:07 +0000 |
commit | b4f41fd76052d050918645abd66a4cbc493b78e6 (patch) | |
tree | 5efe870f0bb1a451fef2bb98afdec6f1a65e12cc | |
parent | a997a5d7b3a2c48da4468dbf577497b5c39592c5 (diff) | |
download | portage-b4f41fd76052d050918645abd66a4cbc493b78e6.tar.gz portage-b4f41fd76052d050918645abd66a4cbc493b78e6.tar.bz2 portage-b4f41fd76052d050918645abd66a4cbc493b78e6.zip |
Fix fetch() mirror:// handling in to comply with section 9.2.8 of PMS.
svn path=/main/trunk/; revision=11537
-rw-r--r-- | pym/portage/__init__.py | 13 |
1 files 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)) |