aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/portage/package/ebuild/fetch.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py
index 7c61fe463..ca031f31e 100644
--- a/lib/portage/package/ebuild/fetch.py
+++ b/lib/portage/package/ebuild/fetch.py
@@ -513,8 +513,12 @@ def get_mirror_url(mirror_url, filename, mysettings, cache_path=None):
json.dump(cache, f)
f.close()
- return (mirror_url + "/distfiles/" +
- urlquote(mirror_conf.get_best_supported_layout().get_path(filename)))
+ # For some protocols, urlquote is required for correct behavior,
+ # and it must not be used for other protocols like rsync and sftp.
+ path = mirror_conf.get_best_supported_layout().get_path(filename)
+ if urlparse(mirror_url).scheme in ('ftp', 'http', 'https'):
+ path = urlquote(path)
+ return mirror_url + "/distfiles/" + path
def fetch(myuris, mysettings, listonly=0, fetchonly=0,