summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2013-08-09 13:51:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-16 11:21:02 +0100
commitbaaa7adc168999bfe09e1f287608cc92f86ec0c0 (patch)
treecd31c6e0c2e1278577a47869a1ecbfb2f31cf6f9
parent6b01c97c7a17e09779a22a648695e73c720f3e6c (diff)
downloadpoky-baaa7adc168999bfe09e1f287608cc92f86ec0c0.tar.gz
bitbake: runqueue: report close matches for an invalid task name
Help to pick up mistakes such as "bitbake -c cleanstate xyz" (instead of "bitbake -c cleansstate xyz".) (Bitbake rev: 15c3db1cffdffd85641c6b12e77f19ce7a553472) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/runqueue.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index b2c9703594..075c84985a 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -601,7 +601,13 @@ class RunQueueData:
601 continue 601 continue
602 602
603 if target[1] not in taskData.tasks_lookup[fnid]: 603 if target[1] not in taskData.tasks_lookup[fnid]:
604 bb.msg.fatal("RunQueue", "Task %s does not exist for target %s" % (target[1], target[0])) 604 import difflib
605 close_matches = difflib.get_close_matches(target[1], taskData.tasks_lookup[fnid], cutoff=0.7)
606 if close_matches:
607 extra = ". Close matches:\n %s" % "\n ".join(close_matches)
608 else:
609 extra = ""
610 bb.msg.fatal("RunQueue", "Task %s does not exist for target %s%s" % (target[1], target[0], extra))
605 611
606 listid = taskData.tasks_lookup[fnid][target[1]] 612 listid = taskData.tasks_lookup[fnid][target[1]]
607 613