summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/ssh.py40
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