summaryrefslogtreecommitdiffstats
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
parent94a57fd87ec020afe27884a30b2d96085bea06cb (diff)
downloadpoky-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>
-rwxr-xr-xbitbake/bin/bitbake25
1 files changed, 18 insertions, 7 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 684bbd6658..29e9acd97a 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -39,15 +39,11 @@ import bb.msg
39from bb import cooker 39from bb import cooker
40from bb import ui 40from bb import ui
41from bb import server 41from bb import server
42from bb.server import none
43#from bb.server import process
44#from bb.server import xmlrpc
45 42
46__version__ = "1.13.2" 43__version__ = "1.13.2"
47logger = logging.getLogger("BitBake") 44logger = logging.getLogger("BitBake")
48 45
49 46
50
51class BBConfiguration(object): 47class BBConfiguration(object):
52 """ 48 """
53 Manages build options and configurations for one run 49 Manages build options and configurations for one run
@@ -160,6 +156,9 @@ Default BBFILES are the .bb files in the current directory.""")
160 parser.add_option("-u", "--ui", help = "userinterface to use", 156 parser.add_option("-u", "--ui", help = "userinterface to use",
161 action = "store", dest = "ui") 157 action = "store", dest = "ui")
162 158
159 parser.add_option("-t", "--servertype", help = "Choose which server to use, none, process or xmlrpc",
160 action = "store", dest = "servertype")
161
163 parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not", 162 parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not",
164 action = "store_true", dest = "revisions_changed", default = False) 163 action = "store_true", dest = "revisions_changed", default = False)
165 164
@@ -170,6 +169,20 @@ Default BBFILES are the .bb files in the current directory.""")
170 169
171 ui_main = get_ui(configuration) 170 ui_main = get_ui(configuration)
172 171
172 # Server type could be xmlrpc or none currently, if nothing is specified,
173 # default server would be none
174 if configuration.servertype:
175 server_type = configuration.servertype
176 else:
177 server_type = 'none'
178
179 try:
180 module = __import__("bb.server", fromlist = [server_type])
181 server = getattr(module, server_type)
182 except AttributeError:
183 sys.exit("FATAL: Invalid server type '%s' specified.\n"
184 "Valid interfaces: xmlrpc, process, none [default]." % servertype)
185
173 # Save a logfile for cooker into the current working directory. When the 186 # Save a logfile for cooker into the current working directory. When the
174 # server is daemonized this logfile will be truncated. 187 # server is daemonized this logfile will be truncated.
175 cooker_logfile = os.path.join(os.getcwd(), "cooker.log") 188 cooker_logfile = os.path.join(os.getcwd(), "cooker.log")
@@ -186,9 +199,7 @@ Default BBFILES are the .bb files in the current directory.""")
186 # of the UIs (e.g. for DISPLAY, etc.) 199 # of the UIs (e.g. for DISPLAY, etc.)
187 bb.utils.clean_environment() 200 bb.utils.clean_environment()
188 201
189 server = bb.server.none.BitBakeServer() 202 server = server.BitBakeServer(
190 #server = bb.server.process.BitBakeServer()
191 #server = bb.server.xmlrpc.BitBakeServer()
192 203
193 server.initServer() 204 server.initServer()
194 idle = server.getServerIdleCB() 205 idle = server.getServerIdleCB()