diff options
Diffstat (limited to 'bitbake/bin/bitbake')
-rwxr-xr-x | bitbake/bin/bitbake | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 86d32cff09..fcfe0434ce 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -200,6 +200,28 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
200 | options.servertype = "xmlrpc" | 200 | options.servertype = "xmlrpc" |
201 | options.remote_server = os.environ["BBSERVER"] | 201 | options.remote_server = os.environ["BBSERVER"] |
202 | 202 | ||
203 | # if BBSERVER says to autodetect, let's do that | ||
204 | if options.remote_server: | ||
205 | [host, port] = options.remote_server.split(":", 2) | ||
206 | port = int(port) | ||
207 | # use automatic port if port set to -1, means read it from | ||
208 | # the bitbake.lock file; this is a bit tricky, but we always expect | ||
209 | # to be in the base of the build directory if we need to have a | ||
210 | # chance to start the server later, anyway | ||
211 | if port == -1: | ||
212 | lock_location = "./bitbake.lock" | ||
213 | # we try to read the address at all times; if the server is not started, | ||
214 | # we'll try to start it after the first connect fails, below | ||
215 | try: | ||
216 | lf = open(lock_location, 'r') | ||
217 | remotedef = lf.readline() | ||
218 | [host, port] = remotedef.split(":") | ||
219 | port = int(port) | ||
220 | lf.close() | ||
221 | options.remote_server = remotedef | ||
222 | except Exception as e: | ||
223 | sys.exit("Failed to read bitbake.lock (%s), invalid port" % str(e)) | ||
224 | |||
203 | return options, targets[1:] | 225 | return options, targets[1:] |
204 | 226 | ||
205 | 227 | ||
@@ -309,7 +331,6 @@ def main(): | |||
309 | # we start a stub server that is actually a XMLRPClient that connects to a real server | 331 | # we start a stub server that is actually a XMLRPClient that connects to a real server |
310 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) | 332 | server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) |
311 | server.saveConnectionDetails(configParams.remote_server) | 333 | server.saveConnectionDetails(configParams.remote_server) |
312 | server.saveConnectionConfigParams(configParams) | ||
313 | 334 | ||
314 | if not configParams.server_only: | 335 | if not configParams.server_only: |
315 | if configParams.status_only: | 336 | if configParams.status_only: |