diff options
Diffstat (limited to 'poky/bitbake/lib/bb/fetch2/ssh.py')
-rw-r--r-- | poky/bitbake/lib/bb/fetch2/ssh.py | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/poky/bitbake/lib/bb/fetch2/ssh.py b/poky/bitbake/lib/bb/fetch2/ssh.py index 2c8557e1f8..484453088f 100644 --- a/poky/bitbake/lib/bb/fetch2/ssh.py +++ b/poky/bitbake/lib/bb/fetch2/ssh.py @@ -40,9 +40,9 @@ __pattern__ = re.compile(r''' ( # Optional username/password block (?P<user>\S+) # username (:(?P<pass>\S+))? # colon followed by the password (optional) - )? (?P<cparam>(;[^;]+)*)? # connection parameters block (optional) @ + )? (?P<host>\S+?) # non-greedy match of the host (:(?P<port>[0-9]+))? # colon followed by the port (optional) / @@ -96,6 +96,11 @@ class SSH(FetchMethod): fr += '@%s' % host else: fr = host + + if path[0] != '~': + path = '/%s' % path + path = path.replace("%3A", ":") + fr += ':%s' % path cmd = 'scp -B -r %s %s %s/' % ( @@ -108,3 +113,43 @@ class SSH(FetchMethod): runfetchcmd(cmd, d) + def checkstatus(self, fetch, urldata, d): + """ + Check the status of the url + """ + m = __pattern__.match(urldata.url) + path = m.group('path') + host = m.group('host') + port = m.group('port') + user = m.group('user') + password = m.group('pass') + + if port: + portarg = '-P %s' % port + else: + portarg = '' + + if user: + fr = user + if password: + fr += ':%s' % password + fr += '@%s' % host + else: + fr = host + + if path[0] != '~': + path = '/%s' % path + path = path.replace("%3A", ":") + + cmd = 'ssh -o BatchMode=true %s %s [ -f %s ]' % ( + portarg, + fr, + path + ) + + check_network_access(d, cmd, urldata.url) + + if runfetchcmd(cmd, d): + return True + + return False |