summaryrefslogtreecommitdiffstats
path: root/bitbake/bin
diff options
context:
space:
mode:
authorLiping Ke <liping.ke@intel.com>2011-06-30 23:02:48 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-07-01 17:17:35 +0100
commitcbd00b89271086d273d0ea39e21cb3c05b5bc052 (patch)
treee548c95c10823fed56a8f88c0a108a3e31ec2ff6 /bitbake/bin
parent94a57fd87ec020afe27884a30b2d96085bea06cb (diff)
downloadast2050-yocto-poky-cbd00b89271086d273d0ea39e21cb3c05b5bc052.zip
ast2050-yocto-poky-cbd00b89271086d273d0ea39e21cb3c05b5bc052.tar.gz
bitbake: Make bitbake server type configurable.
Add -t options in bitbake for configuring server type. (Bitbake rev: 5591329948648927154024bcb882c45766defac2) Signed-off-by: Liping Ke <liping.ke@intel.com> Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-xbitbake/bin/bitbake25
1 files changed, 18 insertions, 7 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 684bbd6..29e9acd 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -39,15 +39,11 @@ import bb.msg
from bb import cooker
from bb import ui
from bb import server
-from bb.server import none
-#from bb.server import process
-#from bb.server import xmlrpc
__version__ = "1.13.2"
logger = logging.getLogger("BitBake")
-
class BBConfiguration(object):
"""
Manages build options and configurations for one run
@@ -160,6 +156,9 @@ Default BBFILES are the .bb files in the current directory.""")
parser.add_option("-u", "--ui", help = "userinterface to use",
action = "store", dest = "ui")
+ parser.add_option("-t", "--servertype", help = "Choose which server to use, none, process or xmlrpc",
+ action = "store", dest = "servertype")
+
parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
action = "store_true", dest = "revisions_changed", default = False)
@@ -170,6 +169,20 @@ Default BBFILES are the .bb files in the current directory.""")
ui_main = get_ui(configuration)
+ # Server type could be xmlrpc or none currently, if nothing is specified,
+ # default server would be none
+ if configuration.servertype:
+ server_type = configuration.servertype
+ else:
+ server_type = 'none'
+
+ try:
+ module = __import__("bb.server", fromlist = [server_type])
+ server = getattr(module, server_type)
+ except AttributeError:
+ sys.exit("FATAL: Invalid server type '%s' specified.\n"
+ "Valid interfaces: xmlrpc, process, none [default]." % servertype)
+
# Save a logfile for cooker into the current working directory. When the
# server is daemonized this logfile will be truncated.
cooker_logfile = os.path.join(os.getcwd(), "cooker.log")
@@ -186,9 +199,7 @@ Default BBFILES are the .bb files in the current directory.""")
# of the UIs (e.g. for DISPLAY, etc.)
bb.utils.clean_environment()
- server = bb.server.none.BitBakeServer()
- #server = bb.server.process.BitBakeServer()
- #server = bb.server.xmlrpc.BitBakeServer()
+ server = server.BitBakeServer(
server.initServer()
idle = server.getServerIdleCB()
OpenPOWER on IntegriCloud