diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2017-07-17 01:27:14 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-21 08:41:11 +0100 |
commit | c276e38bf8f20d9f6ef0645d3c3050b383ac794a (patch) | |
tree | 2100c87537651df079c898e7528c52fb3ba67b6f /bitbake/lib/bb/main.py | |
parent | 38af7fef512601423c231ae61959b12ec54575cc (diff) | |
download | poky-c276e38bf8f20d9f6ef0645d3c3050b383ac794a.tar.gz |
bitbake: bb/main.py: avoid starting server when not needed
Fixed 1:
$ . ../poky/oe-init-build-env-memres .
$ bitbake -m
$ bitbake -m # shutdown it again
$ bitbake -m
Starting bitbake server...
Terminated bitbake server.
It starts the server and kill it which is redundant.
$ bitbake -m
$ bitbake --status-only
Starting bitbake server...
It starts the server which is not what we need.
(Bitbake rev: 335fd0106359dddfe1eeb0c7d0bc03f8454b895c)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/main.py')
-rwxr-xr-x | bitbake/lib/bb/main.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py index 84fe904efb..b09513f462 100755 --- a/bitbake/lib/bb/main.py +++ b/bitbake/lib/bb/main.py | |||
@@ -368,8 +368,10 @@ def bitbake_main(configParams, configuration): | |||
368 | configuration.debug_domains) | 368 | configuration.debug_domains) |
369 | 369 | ||
370 | server_connection, ui_module = setup_bitbake(configParams, configuration) | 370 | server_connection, ui_module = setup_bitbake(configParams, configuration) |
371 | if server_connection is None and configParams.kill_server: | 371 | # No server connection |
372 | return 0 | 372 | if server_connection is None: |
373 | if configParams.status_only or configParams.kill_server: | ||
374 | return 1 | ||
373 | 375 | ||
374 | if not configParams.server_only: | 376 | if not configParams.server_only: |
375 | if configParams.status_only: | 377 | if configParams.status_only: |
@@ -426,6 +428,10 @@ def setup_bitbake(configParams, configuration, extrafeatures=None, setup_logging | |||
426 | topdir, lock = lockBitbake() | 428 | topdir, lock = lockBitbake() |
427 | sockname = topdir + "/bitbake.sock" | 429 | sockname = topdir + "/bitbake.sock" |
428 | if lock: | 430 | if lock: |
431 | if configParams.status_only or configParams.kill_server: | ||
432 | logger.info("bitbake server is not running.") | ||
433 | lock.close() | ||
434 | return None, None | ||
429 | # we start a server with a given configuration | 435 | # we start a server with a given configuration |
430 | logger.info("Starting bitbake server...") | 436 | logger.info("Starting bitbake server...") |
431 | server = bb.server.process.BitBakeServer(lock, sockname, configuration, featureset) | 437 | server = bb.server.process.BitBakeServer(lock, sockname, configuration, featureset) |