From 98a4a4a613de4e7a38e2f7d8c941d23b21f577cd Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Thu, 21 Apr 2022 17:12:31 +0800 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/ssh.py | 6 ++++-- 1 file 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: import re, os from bb.fetch2 import check_network_access, FetchMethod, ParameterError, runfetchcmd +import urllib __pattern__ = re.compile(r''' @@ -70,6 +71,7 @@ class SSH(FetchMethod): "git:// prefix with protocol=ssh", urldata.url) m = __pattern__.match(urldata.url) path = m.group('path') + path = urllib.parse.unquote(path) host = m.group('host') urldata.localpath = os.path.join(d.getVar('DL_DIR'), os.path.basename(os.path.normpath(path))) @@ -99,7 +101,7 @@ class SSH(FetchMethod): if path[0] != '~': path = '/%s' % path - path = path.replace("%3A", ":") + path = urllib.parse.unquote(path) fr += ':%s' % path @@ -139,7 +141,7 @@ class SSH(FetchMethod): if path[0] != '~': path = '/%s' % path - path = path.replace("%3A", ":") + path = urllib.parse.unquote(path) cmd = 'ssh -o BatchMode=true %s %s [ -f %s ]' % ( portarg, -- cgit v1.2.3-54-g00ecf