diff options
author | Jussi Kukkonen <jussi.kukkonen@intel.com> | 2016-10-10 11:30:04 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-11 08:29:49 +0100 |
commit | 0f042b1e1f45682cd418b316216dc507c92c1ace (patch) | |
tree | ea9476bbc20d00662637d04026df99a5e83cdf0b /bitbake/lib/bb/ui | |
parent | b8f4804a3f1cda7a014932e2fa020cc6527aa12b (diff) | |
download | poky-0f042b1e1f45682cd418b316216dc507c92c1ace.tar.gz |
bitbake: depexp: Close UI with error message on NoProvider event
Without this the UI just sits there doing nothing. Showing an
infobar in-UI would be nicer but not much more useful since currently
user couldn't do anything in-UI to fix the situation. Implementation
is based on the one in knotty.
Fixes [YOCTO #9288]
(Bitbake rev: eee9231a543f1d0b9ef3cd8377fc46fd23afb97b)
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/depexp.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/depexp.py b/bitbake/lib/bb/ui/depexp.py index 995703d3dc..d879e04c0d 100644 --- a/bitbake/lib/bb/ui/depexp.py +++ b/bitbake/lib/bb/ui/depexp.py | |||
@@ -301,6 +301,30 @@ def main(server, eventHandler, params): | |||
301 | if isinstance(event, bb.command.CommandCompleted): | 301 | if isinstance(event, bb.command.CommandCompleted): |
302 | continue | 302 | continue |
303 | 303 | ||
304 | if isinstance(event, bb.event.NoProvider): | ||
305 | if event._runtime: | ||
306 | r = "R" | ||
307 | else: | ||
308 | r = "" | ||
309 | |||
310 | extra = '' | ||
311 | if not event._reasons: | ||
312 | if event._close_matches: | ||
313 | extra = ". Close matches:\n %s" % '\n '.join(event._close_matches) | ||
314 | |||
315 | if event._dependees: | ||
316 | print("Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s" % r, event._item, ", ".join(event._dependees), r, extra) | ||
317 | else: | ||
318 | print("Nothing %sPROVIDES '%s'%s" % (r, event._item, extra)) | ||
319 | if event._reasons: | ||
320 | for reason in event._reasons: | ||
321 | print(reason) | ||
322 | |||
323 | _, error = server.runCommand(["stateShutdown"]) | ||
324 | if error: | ||
325 | print('Unable to cleanly shutdown: %s' % error) | ||
326 | break | ||
327 | |||
304 | if isinstance(event, bb.command.CommandFailed): | 328 | if isinstance(event, bb.command.CommandFailed): |
305 | print("Command execution failed: %s" % event.error) | 329 | print("Command execution failed: %s" % event.error) |
306 | return event.exitcode | 330 | return event.exitcode |