summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/knotty.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-07-19 11:56:03 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-21 08:41:12 +0100
commit21bb330f4632ae9e8dd9eaff2879bcd24f9cf194 (patch)
tree476a3ff0b5d7fc0f89fafc0cba2b720a6e6b5f3e /bitbake/lib/bb/ui/knotty.py
parenteb7401d47087ba2347dcf780a0d07969bed4c072 (diff)
downloadpoky-21bb330f4632ae9e8dd9eaff2879bcd24f9cf194.tar.gz
bitbake: lib/bb/event: refactor printing events
We really ought to have just one place where the string representation of these events is produced. This doesn't take any real control away from the UI - if an alternative representation is desired, that can still be made. (Bitbake rev: cb15db2a799be6d8eab9a2a43a9a573f89229cff) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/knotty.py')
-rw-r--r--bitbake/lib/bb/ui/knotty.py37
1 files changed, 6 insertions, 31 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 1aa5ebb287..c3019822c4 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -560,7 +560,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
560 return_value = event.exitcode 560 return_value = event.exitcode
561 if event.error: 561 if event.error:
562 errors = errors + 1 562 errors = errors + 1
563 logger.error("Command execution failed: %s", event.error) 563 logger.error(str(event))
564 main.shutdown = 2 564 main.shutdown = 2
565 continue 565 continue
566 if isinstance(event, bb.command.CommandExit): 566 if isinstance(event, bb.command.CommandExit):
@@ -571,39 +571,16 @@ def main(server, eventHandler, params, tf = TerminalFilter):
571 main.shutdown = 2 571 main.shutdown = 2
572 continue 572 continue
573 if isinstance(event, bb.event.MultipleProviders): 573 if isinstance(event, bb.event.MultipleProviders):
574 logger.info("multiple providers are available for %s%s (%s)", event._is_runtime and "runtime " or "", 574 logger.info(str(event))
575 event._item,
576 ", ".join(event._candidates))
577 rtime = ""
578 if event._is_runtime:
579 rtime = "R"
580 logger.info("consider defining a PREFERRED_%sPROVIDER entry to match %s" % (rtime, event._item))
581 continue 575 continue
582 if isinstance(event, bb.event.NoProvider): 576 if isinstance(event, bb.event.NoProvider):
583 if event._runtime:
584 r = "R"
585 else:
586 r = ""
587
588 extra = ''
589 if not event._reasons:
590 if event._close_matches:
591 extra = ". Close matches:\n %s" % '\n '.join(event._close_matches)
592
593 # For universe builds, only show these as warnings, not errors 577 # For universe builds, only show these as warnings, not errors
594 h = logger.warning
595 if not universe: 578 if not universe:
596 return_value = 1 579 return_value = 1
597 errors = errors + 1 580 errors = errors + 1
598 h = logger.error 581 logger.error(str(event))
599
600 if event._dependees:
601 h("Nothing %sPROVIDES '%s' (but %s %sDEPENDS on or otherwise requires it)%s", r, event._item, ", ".join(event._dependees), r, extra)
602 else: 582 else:
603 h("Nothing %sPROVIDES '%s'%s", r, event._item, extra) 583 logger.warning(str(event))
604 if event._reasons:
605 for reason in event._reasons:
606 h("%s", reason)
607 continue 584 continue
608 585
609 if isinstance(event, bb.runqueue.sceneQueueTaskStarted): 586 if isinstance(event, bb.runqueue.sceneQueueTaskStarted):
@@ -625,13 +602,11 @@ def main(server, eventHandler, params, tf = TerminalFilter):
625 if isinstance(event, bb.runqueue.runQueueTaskFailed): 602 if isinstance(event, bb.runqueue.runQueueTaskFailed):
626 return_value = 1 603 return_value = 1
627 taskfailures.append(event.taskstring) 604 taskfailures.append(event.taskstring)
628 logger.error("Task (%s) failed with exit code '%s'", 605 logger.error(str(event))
629 event.taskstring, event.exitcode)
630 continue 606 continue
631 607
632 if isinstance(event, bb.runqueue.sceneQueueTaskFailed): 608 if isinstance(event, bb.runqueue.sceneQueueTaskFailed):
633 logger.warning("Setscene task (%s) failed with exit code '%s' - real task will be run instead", 609 logger.warning(str(event))
634 event.taskstring, event.exitcode)
635 continue 610 continue
636 611
637 if isinstance(event, bb.event.DepTreeGenerated): 612 if isinstance(event, bb.event.DepTreeGenerated):