summaryrefslogtreecommitdiffstats
path: root/bin/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-06-03 16:26:10 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-06 10:32:03 +0100
commitac5753274ff932e1d6f073ab4dab7bd6fe5355a1 (patch)
treecf91a0ec3d857f0c56158c3dd79c16970e73dd4c /bin/bitbake
parent18f9bcbad059608e22fca20309314e1c399acec7 (diff)
downloadbitbake-contrib-ac5753274ff932e1d6f073ab4dab7bd6fe5355a1.tar.gz
bitbake: move configuration reading code
The configuration reading code should live in the main bitbake entry point, and the server modules should be supplied with correct configuration instead of attempting to parse from configuration files. This patch moves the endpoint address reading from XMLRPC to the bitbake main script. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin/bitbake')
-rwxr-xr-xbin/bitbake23
1 files changed, 22 insertions, 1 deletions
diff --git a/bin/bitbake b/bin/bitbake
index 86d32cff0..fcfe0434c 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -200,6 +200,28 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
options.servertype = "xmlrpc"
options.remote_server = os.environ["BBSERVER"]
+ # if BBSERVER says to autodetect, let's do that
+ if options.remote_server:
+ [host, port] = options.remote_server.split(":", 2)
+ port = int(port)
+ # use automatic port if port set to -1, means read it from
+ # the bitbake.lock file; this is a bit tricky, but we always expect
+ # to be in the base of the build directory if we need to have a
+ # chance to start the server later, anyway
+ if port == -1:
+ lock_location = "./bitbake.lock"
+ # we try to read the address at all times; if the server is not started,
+ # we'll try to start it after the first connect fails, below
+ try:
+ lf = open(lock_location, 'r')
+ remotedef = lf.readline()
+ [host, port] = remotedef.split(":")
+ port = int(port)
+ lf.close()
+ options.remote_server = remotedef
+ except Exception as e:
+ sys.exit("Failed to read bitbake.lock (%s), invalid port" % str(e))
+
return options, targets[1:]
@@ -309,7 +331,6 @@ def main():
# we start a stub server that is actually a XMLRPClient that connects to a real server
server = servermodule.BitBakeXMLRPCClient(configParams.observe_only)
server.saveConnectionDetails(configParams.remote_server)
- server.saveConnectionConfigParams(configParams)
if not configParams.server_only:
if configParams.status_only: