1 |
commit: c238d5f7ed264179c263f5a2da983c4ee50b4f00 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 31 21:24:25 2020 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 31 21:30:14 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c238d5f7 |
7 |
|
8 |
Escape percent-signs in portage.package.ebuild.fetch.get_mirror_url() |
9 |
|
10 |
This avoids double-escaping in emirrordist. We only want to escape the |
11 |
path when fetching the file from the mirror, not when mirroring the |
12 |
file. |
13 |
|
14 |
Bug: https://bugs.gentoo.org/719810 |
15 |
Fixes: 4c18f523bb86a8be4c148f365dabee06fca2e4fa |
16 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
17 |
|
18 |
lib/portage/package/ebuild/fetch.py | 7 ++++++- |
19 |
1 file changed, 6 insertions(+), 1 deletion(-) |
20 |
|
21 |
diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py |
22 |
index 28e7caf53..9682fea89 100644 |
23 |
--- a/lib/portage/package/ebuild/fetch.py |
24 |
+++ b/lib/portage/package/ebuild/fetch.py |
25 |
@@ -26,6 +26,11 @@ try: |
26 |
except ImportError: |
27 |
from urlparse import urlparse |
28 |
|
29 |
+try: |
30 |
+ from urllib.parse import quote as urlquote |
31 |
+except ImportError: |
32 |
+ from urllib import quote as urlquote |
33 |
+ |
34 |
import portage |
35 |
portage.proxy.lazyimport.lazyimport(globals(), |
36 |
'portage.package.ebuild.config:check_config_instance,config', |
37 |
@@ -520,7 +525,7 @@ def get_mirror_url(mirror_url, filename, mysettings, cache_path=None): |
38 |
f.close() |
39 |
|
40 |
return (mirror_url + "/distfiles/" + |
41 |
- mirror_conf.get_best_supported_layout().get_path(filename)) |
42 |
+ urlquote(mirror_conf.get_best_supported_layout().get_path(filename))) |
43 |
|
44 |
|
45 |
def fetch(myuris, mysettings, listonly=0, fetchonly=0, |