summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/main.py
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-07-19 22:54:38 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-21 07:48:52 +0100
commit4cba010529b558bfbcf546942197277f8ce1b63e (patch)
tree3b1d8d76e980ffc08757872b9489b57d3a1f87ee /bitbake/lib/bb/main.py
parent380b6e80cea6ffaaeceaac7d67660c334a0a22ca (diff)
downloadpoky-4cba010529b558bfbcf546942197277f8ce1b63e.tar.gz
bitbake: bitbake: implement --foreground command line option
This option makes bitbake xmlrpc server to run in foreground. It should be useful for debugging purposes. (Bitbake rev: 9d4254be5853a546a346bf0d19919dcfba12773d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/main.py')
-rwxr-xr-xbitbake/lib/bb/main.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index 1c32e9308d..849cade8ca 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -247,6 +247,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
247 help="Run bitbake without a UI, only starting a server " 247 help="Run bitbake without a UI, only starting a server "
248 "(cooker) process.") 248 "(cooker) process.")
249 249
250 parser.add_option("", "--foreground", action="store_true",
251 help="Run bitbake server in foreground.")
252
250 parser.add_option("-B", "--bind", action="store", dest="bind", default=False, 253 parser.add_option("-B", "--bind", action="store", dest="bind", default=False,
251 help="The name/address for the bitbake server to bind to.") 254 help="The name/address for the bitbake server to bind to.")
252 255
@@ -357,7 +360,8 @@ def start_server(servermodule, configParams, configuration, features):
357 if isinstance(event, logging.LogRecord): 360 if isinstance(event, logging.LogRecord):
358 logger.handle(event) 361 logger.handle(event)
359 raise 362 raise
360 server.detach() 363 if not configParams.foreground:
364 server.detach()
361 cooker.lock.close() 365 cooker.lock.close()
362 return server 366 return server
363 367
@@ -398,6 +402,10 @@ def bitbake_main(configParams, configuration):
398 ("the BBSERVER environment variable" if "BBSERVER" in os.environ \ 402 ("the BBSERVER environment variable" if "BBSERVER" in os.environ \
399 else "the '--remote-server' option")) 403 else "the '--remote-server' option"))
400 404
405 elif configParams.foreground:
406 raise BBMainException("FATAL: The '--foreground' option can only be used "
407 "with --server-only.\n")
408
401 if configParams.bind and configParams.servertype != "xmlrpc": 409 if configParams.bind and configParams.servertype != "xmlrpc":
402 raise BBMainException("FATAL: If '-B' or '--bind' is defined, we must " 410 raise BBMainException("FATAL: If '-B' or '--bind' is defined, we must "
403 "set the servertype as 'xmlrpc'.\n") 411 "set the servertype as 'xmlrpc'.\n")
@@ -495,6 +503,8 @@ def bitbake_main(configParams, configuration):
495 else: 503 else:
496 print("Bitbake server address: %s, server port: %s" % (server.serverImpl.host, 504 print("Bitbake server address: %s, server port: %s" % (server.serverImpl.host,
497 server.serverImpl.port)) 505 server.serverImpl.port))
506 if configParams.foreground:
507 server.serverImpl.serve_forever()
498 return 0 508 return 0
499 509
500 return 1 510 return 1