diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2013-11-25 15:21:25 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-02 11:28:27 +0000 |
commit | 0bea372b0fe6d77b2f6b742214f97a0db79e3990 (patch) | |
tree | f71ce80e96d8858b40c250f5f229875714979680 /bitbake | |
parent | 72e650d97cdf9dcdafc5000b7b784798dbb634c8 (diff) | |
download | poky-0bea372b0fe6d77b2f6b742214f97a0db79e3990.tar.gz |
bitbake: bitbake: Add --status-only option
The --status-only option is purely to check the health of the server.
The idea is to use it from the oe environment script so as to know if
the server needs to be started or not.
(Bitbake rev: 46b26ef5c27bfa9c91680f494f02750305b8098c)
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-x | bitbake/bin/bitbake | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake index 50971a8d8f..cca2b8d29b 100755 --- a/bitbake/bin/bitbake +++ b/bitbake/bin/bitbake | |||
@@ -190,6 +190,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters): | |||
190 | parser.add_option("", "--observe-only", help = "Connect to a server as an observing-only client.", | 190 | parser.add_option("", "--observe-only", help = "Connect to a server as an observing-only client.", |
191 | action = "store_true", dest = "observe_only", default = False) | 191 | action = "store_true", dest = "observe_only", default = False) |
192 | 192 | ||
193 | parser.add_option("", "--status-only", help = "Check the status of the remote bitbake server.", | ||
194 | action = "store_true", dest = "status_only", default = False) | ||
195 | |||
193 | options, targets = parser.parse_args(sys.argv) | 196 | options, targets = parser.parse_args(sys.argv) |
194 | 197 | ||
195 | # some environmental variables set also configuration options | 198 | # some environmental variables set also configuration options |
@@ -284,7 +287,9 @@ def main(): | |||
284 | 287 | ||
285 | # Ensure logging messages get sent to the UI as events | 288 | # Ensure logging messages get sent to the UI as events |
286 | handler = bb.event.LogHandler() | 289 | handler = bb.event.LogHandler() |
287 | logger.addHandler(handler) | 290 | if not configParams.status_only: |
291 | # In status only mode there are no logs and no UI | ||
292 | logger.addHandler(handler) | ||
288 | 293 | ||
289 | # Clear away any spurious environment variables while we stoke up the cooker | 294 | # Clear away any spurious environment variables while we stoke up the cooker |
290 | cleanedvars = bb.utils.clean_environment() | 295 | cleanedvars = bb.utils.clean_environment() |
@@ -302,6 +307,14 @@ def main(): | |||
302 | # Collect the feature set for the UI | 307 | # Collect the feature set for the UI |
303 | featureset = getattr(ui_module, "featureSet", []) | 308 | featureset = getattr(ui_module, "featureSet", []) |
304 | 309 | ||
310 | if configParams.status_only: | ||
311 | try: | ||
312 | server_connection = server.establishConnection(featureset) | ||
313 | except: | ||
314 | sys.exit(1) | ||
315 | server_connection.terminate() | ||
316 | sys.exit(0) | ||
317 | |||
305 | # Setup a connection to the server (cooker) | 318 | # Setup a connection to the server (cooker) |
306 | server_connection = server.establishConnection(featureset) | 319 | server_connection = server.establishConnection(featureset) |
307 | 320 | ||