summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2022-05-10 08:05:40 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-05-12 13:41:42 +0100
commitb34c2994674efa31b59f55e6af1480c01d616fa3 (patch)
treea739ef89446aa8691050376e1e0aaae74803ff3e
parentb6df0485bc18bd4e3a103b2f78b7edefe10d9ad0 (diff)
downloadpoky-b34c2994674efa31b59f55e6af1480c01d616fa3.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: 3969786a787eea34e096b932d52cd02978aacb8e) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c1c8fc678eb4783cea3974328a5fa8d1b79f1266) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/ssh.py6
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
33import re, os 33import re, os
34from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd 34from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd
35import 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,