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

Paul Eggleton paul.eggleton at linux.intel.com
Tue Aug 13 20:46:31 UTC 2013


On Tuesday 13 August 2013 21:18:18 Richard Purdie wrote:
> 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 = ""?

Oops. Fixed on the branch.

Thanks,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the bitbake-devel mailing list