Patchwork [bitbake-devel,1/4] bitbake-diffsigs: handle if task name is specified without do_ prefix

login
register
mail settings
Submitter Paul Eggleton
Date Oct. 4, 2013, 4:44 p.m.
Message ID <6b322934d5cc34601098dc935400e0e8a6e7df1e.1380904913.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/59269/
State New
Headers show

Comments

Paul Eggleton - Oct. 4, 2013, 4:44 p.m.
Warn the user and adjust the task name automatically if the -t option
is specified with a task name that doesn't start with do_ (e.g.
"configure" instead of "do_configure").

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 bitbake/bin/bitbake-diffsigs | 4 ++++
 1 file changed, 4 insertions(+)
Paul Eggleton - Oct. 4, 2013, 5:04 p.m.
On Friday 04 October 2013 17:44:25 Paul Eggleton wrote:
> Warn the user and adjust the task name automatically if the -t option
> is specified with a task name that doesn't start with do_ (e.g.
> "configure" instead of "do_configure").
> 
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  bitbake/bin/bitbake-diffsigs | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/bitbake/bin/bitbake-diffsigs b/bitbake/bin/bitbake-diffsigs
> index 3ce70da..6e4c44a 100755
> --- a/bitbake/bin/bitbake-diffsigs
> +++ b/bitbake/bin/bitbake-diffsigs
> @@ -39,6 +39,10 @@ def find_compare_task(bbhandler, pn, taskname):
>          logger.error('Metadata does not support finding signature data
> files') sys.exit(1)
> 
> +    if not taskname.startswith('do_'):
> +        logger.warn('Invalid task name "%s" - assuming you meant "do_%s"' %
> (taskname, taskname)) +        taskname = 'do_%s' % taskname
> +
>      filedates = bb.siggen.find_siginfo(pn, taskname, None,
> bbhandler.config_data) latestfiles = sorted(filedates.keys(), key=lambda f:
> filedates[f])[-2:] if not latestfiles:

I've dropped the warning message on the branch after discussion with Richard - 
the do_ prefix is really an internal detail and users are used to specifying 
these without the prefix when using bitbake -c.

Cheers,
Paul

Patch

diff --git a/bitbake/bin/bitbake-diffsigs b/bitbake/bin/bitbake-diffsigs
index 3ce70da..6e4c44a 100755
--- a/bitbake/bin/bitbake-diffsigs
+++ b/bitbake/bin/bitbake-diffsigs
@@ -39,6 +39,10 @@  def find_compare_task(bbhandler, pn, taskname):
         logger.error('Metadata does not support finding signature data files')
         sys.exit(1)
 
+    if not taskname.startswith('do_'):
+        logger.warn('Invalid task name "%s" - assuming you meant "do_%s"' % (taskname, taskname))
+        taskname = 'do_%s' % taskname
+
     filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
     latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-2:]
     if not latestfiles: