]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: depexp: Close UI with error message on NoProvider event
authorJussi Kukkonen <jussi.kukkonen@intel.com>
Mon, 10 Oct 2016 08:30:04 +0000 (11:30 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Oct 2016 07:29:49 +0000 (08:29 +0100)
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>
bitbake/lib/bb/ui/depexp.py

index 995703d3dc14084ed822b697856d75301096397b..d879e04c0df736badb8d99e033c30567f39ad9f4 100644 (file)
@@ -301,6 +301,30 @@ def main(server, eventHandler, params):
             if isinstance(event, bb.command.CommandCompleted):
                 continue
 
+            if isinstance(event, bb.event.NoProvider):
+                if event._runtime:
+                    r = "R"
+                else:
+                    r = ""
+
+                extra = ''
+                if not event._reasons:
+                    if event._close_matches:
+                        extra = ". Close matches:\n  %s" % '\n  '.join(event._close_matches)
+
+                if event._dependees:
+                    print("Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s" % r, event._item, ", ".join(event._dependees), r, extra)
+                else:
+                    print("Nothing %sPROVIDES '%s'%s" % (r, event._item, extra))
+                if event._reasons:
+                    for reason in event._reasons:
+                        print(reason)
+
+                _, error = server.runCommand(["stateShutdown"])
+                if error:
+                    print('Unable to cleanly shutdown: %s' % error)
+                break
+
             if isinstance(event, bb.command.CommandFailed):
                 print("Command execution failed: %s" % event.error)
                 return event.exitcode