Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Paul Eggleton <paul.eggleton@linux.intel.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 1/2] runqueue: report close matches for an invalid task name
Date: Tue, 13 Aug 2013 21:18:18 +0100	[thread overview]
Message-ID: <1376425098.1838.27.camel@ted> (raw)
In-Reply-To: <3da24015e63e0ed7223d668790027ede24a5c02e.1376403450.git.paul.eggleton@linux.intel.com>

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@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



  reply	other threads:[~2013-08-13 20:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 14:18 [PATCH 0/2] Show close matches for invalid task/target Paul Eggleton
2013-08-13 14:18 ` [PATCH 1/2] runqueue: report close matches for an invalid task name Paul Eggleton
2013-08-13 20:18   ` Richard Purdie [this message]
2013-08-13 20:46     ` Paul Eggleton
2013-08-13 14:18 ` [PATCH 2/2] taskdata: report close matches with NoProvider errors Paul Eggleton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376425098.1838.27.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=paul.eggleton@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox