diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2022-04-21 17:12:31 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-27 11:21:31 +0100 |
commit | 98a4a4a613de4e7a38e2f7d8c941d23b21f577cd (patch) | |
tree | 407e8cade87a575bdaada061aedc8ca6ff24789c /bitbake | |
parent | 1bd70f469deba2c511451afc398f80db1e303124 (diff) | |
download | poky-98a4a4a613de4e7a38e2f7d8c941d23b21f577cd.tar.gz |
bitbake: fetch2/ssh.py: decode path back for ssh
The path has been encoded by urllib.parse.quote(), so decode it back for ssh.
Fixed when fetch from PREMIRRORS via ssh:
$ bitbake bonnie++ libsigc++-2.0 -cfetch
scp: /path/to/downloads/libsigc%2B%2B-2.10.7.tar.xz: No such file or directory
(Bitbake rev: c1c8fc678eb4783cea3974328a5fa8d1b79f1266)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/fetch2/ssh.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/ssh.py b/bitbake/lib/bb/fetch2/ssh.py index 484453088f..8d082b38c1 100644 --- a/bitbake/lib/bb/fetch2/ssh.py +++ b/bitbake/lib/bb/fetch2/ssh.py | |||
@@ -32,6 +32,7 @@ IETF secsh internet draft: | |||
32 | 32 | ||
33 | import re, os | 33 | import re, os |
34 | from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd | 34 | from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd |
35 | import urllib | ||
35 | 36 | ||
36 | 37 | ||
37 | __pattern__ = re.compile(r''' | 38 | __pattern__ = re.compile(r''' |
@@ -70,6 +71,7 @@ class SSH(FetchMethod): | |||
70 | "git:// prefix with protocol=ssh", urldata.url) | 71 | "git:// prefix with protocol=ssh", urldata.url) |
71 | m = __pattern__.match(urldata.url) | 72 | m = __pattern__.match(urldata.url) |
72 | path = m.group('path') | 73 | path = m.group('path') |
74 | path = urllib.parse.unquote(path) | ||
73 | host = m.group('host') | 75 | host = m.group('host') |
74 | urldata.localpath = os.path.join(d.getVar('DL_DIR'), | 76 | urldata.localpath = os.path.join(d.getVar('DL_DIR'), |
75 | os.path.basename(os.path.normpath(path))) | 77 | os.path.basename(os.path.normpath(path))) |
@@ -99,7 +101,7 @@ class SSH(FetchMethod): | |||
99 | 101 | ||
100 | if path[0] != '~': | 102 | if path[0] != '~': |
101 | path = '/%s' % path | 103 | path = '/%s' % path |
102 | path = path.replace("%3A", ":") | 104 | path = urllib.parse.unquote(path) |
103 | 105 | ||
104 | fr += ':%s' % path | 106 | fr += ':%s' % path |
105 | 107 | ||
@@ -139,7 +141,7 @@ class SSH(FetchMethod): | |||
139 | 141 | ||
140 | if path[0] != '~': | 142 | if path[0] != '~': |
141 | path = '/%s' % path | 143 | path = '/%s' % path |
142 | path = path.replace("%3A", ":") | 144 | path = urllib.parse.unquote(path) |
143 | 145 | ||
144 | cmd = 'ssh -o BatchMode=true %s %s [ -f %s ]' % ( | 146 | cmd = 'ssh -o BatchMode=true %s %s [ -f %s ]' % ( |
145 | portarg, | 147 | portarg, |