diff options
| author | Daniel Wagenknecht <dwagenknecht@emlix.com> | 2022-03-02 20:50:36 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-03-04 17:24:53 +0000 |
| commit | fe0d6dbef5583a2382bdee6a6dcabc6248588d1e (patch) | |
| tree | 22ce51972871f9148d5ae6cc45573283b472932f /bitbake/lib | |
| parent | 5937b2e07306ec77c14a98dc90f011dd8c90e92e (diff) | |
| download | poky-fe0d6dbef5583a2382bdee6a6dcabc6248588d1e.tar.gz | |
bitbake: fetch2: ssh: support checkstatus
This implements support for sstate mirrors using ssh as transport
protocol.
(Bitbake rev: 0a3b5b3de7bcb1c5c3748cba42d394cc484e966b)
Signed-off-by: Daniel Wagenknecht <dwagenknecht@emlix.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/bb/fetch2/ssh.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/ssh.py b/bitbake/lib/bb/fetch2/ssh.py index a985de4ce0..484453088f 100644 --- a/bitbake/lib/bb/fetch2/ssh.py +++ b/bitbake/lib/bb/fetch2/ssh.py | |||
| @@ -113,3 +113,43 @@ class SSH(FetchMethod): | |||
| 113 | 113 | ||
| 114 | runfetchcmd(cmd, d) | 114 | runfetchcmd(cmd, d) |
| 115 | 115 | ||
| 116 | def checkstatus(self, fetch, urldata, d): | ||
| 117 | """ | ||
| 118 | Check the status of the url | ||
| 119 | """ | ||
| 120 | m = __pattern__.match(urldata.url) | ||
| 121 | path = m.group('path') | ||
| 122 | host = m.group('host') | ||
| 123 | port = m.group('port') | ||
| 124 | user = m.group('user') | ||
| 125 | password = m.group('pass') | ||
| 126 | |||
| 127 | if port: | ||
| 128 | portarg = '-P %s' % port | ||
| 129 | else: | ||
| 130 | portarg = '' | ||
| 131 | |||
| 132 | if user: | ||
| 133 | fr = user | ||
| 134 | if password: | ||
| 135 | fr += ':%s' % password | ||
| 136 | fr += '@%s' % host | ||
| 137 | else: | ||
| 138 | fr = host | ||
| 139 | |||
| 140 | if path[0] != '~': | ||
| 141 | path = '/%s' % path | ||
| 142 | path = path.replace("%3A", ":") | ||
| 143 | |||
| 144 | cmd = 'ssh -o BatchMode=true %s %s [ -f %s ]' % ( | ||
| 145 | portarg, | ||
| 146 | fr, | ||
| 147 | path | ||
| 148 | ) | ||
| 149 | |||
| 150 | check_network_access(d, cmd, urldata.url) | ||
| 151 | |||
| 152 | if runfetchcmd(cmd, d): | ||
| 153 | return True | ||
| 154 | |||
| 155 | return False | ||
