Patchwork [bitbake-devel,2/2] bitbake: read BBSERVER environement for remote server

login
register
mail settings
Submitter Alexandru DAMIAN
Date June 13, 2013, 3:23 p.m.
Message ID <1371137015-4416-2-git-send-email-alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/51689/
State Accepted
Commit 81929f86c57ed0a4ad0cda7aaa820fceabaa61e9
Headers show

Comments

Alexandru DAMIAN - June 13, 2013, 3:23 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

This change allows bitbake to connect to a remote server
by reading the BBSERVER environment variable and effecting
the config. Basically a shortcut to the command line parameters.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 bin/bitbake | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch

diff --git a/bin/bitbake b/bin/bitbake
index e924eec..1c2214d 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -204,6 +204,12 @@  class BitBakeConfigParameters(cookerdata.ConfigParameters):
                    action = "store_true", dest = "observe_only", default = False)
 
         options, targets = parser.parse_args(sys.argv)
+
+        # some environmental variables set also configuration options
+        if "BBSERVER" in os.environ:
+            options.servertype = "xmlrpc"
+            options.remote_server = os.environ["BBSERVER"]
+
         return options, targets[1:]
 
 
@@ -268,6 +274,9 @@  def main():
             sys.exit("FATAL: If '--server-only' is defined, we must set the servertype as 'xmlrpc'.\n")
         if not configParams.bind:
             sys.exit("FATAL: The '--server-only' option requires a name/address to bind to with the -B option.\n")
+        if configParams.remote_server:
+            sys.exit("FATAL: The '--server-only' option conflicts with the '--remote-server' option. %s\n" % 
+                ("Please check your BBSERVER environment" if "BBSERVER" in os.environ else "" ))
 
     if configParams.bind and configParams.servertype != "xmlrpc":
         sys.exit("FATAL: If '-B' or '--bind' is defined, we must set the servertype as 'xmlrpc'.\n")