[bitbake-devel] [PATCH 1/2] runqueue: report close matches for an invalid task name

Richard Purdie richard.purdie at linuxfoundation.org
Tue Aug 13 20:18:18 UTC 2013


On Tue, 2013-08-13 at 15:18 +0100, Paul Eggleton wrote:
> Help to pick up mistakes such as "bitbake -c cleanstate xyz" (instead
> of "bitbake -c cleansstate xyz".)
> 
> Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
> ---
>  bitbake/lib/bb/runqueue.py | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
> index b2c9703..b3374f1 100644
> --- a/bitbake/lib/bb/runqueue.py
> +++ b/bitbake/lib/bb/runqueue.py
> @@ -601,7 +601,11 @@ class RunQueueData:
>                  continue
>  
>              if target[1] not in taskData.tasks_lookup[fnid]:
> -                bb.msg.fatal("RunQueue", "Task %s does not exist for target %s" % (target[1], target[0]))
> +                import difflib
> +                close_matches = difflib.get_close_matches(target[1], taskData.tasks_lookup[fnid], cutoff=0.7)
> +                if close_matches:
> +                    extra = ". Close matches:\n  %s" % "\n  ".join(close_matches)
> +                bb.msg.fatal("RunQueue", "Task %s does not exist for target %s%s" % (target[1], target[0], extra))

Missing else: extra = ""?

Cheers,

Richard




More information about the bitbake-devel mailing list