Patchwork [bitbake-devel,1/1] bitbake: runqueue: add warning in invalidate task

login
register
mail settings
Submitter Petter Mabäcker
Date July 29, 2013, 9:19 a.m.
Message ID <c8e2317302a86e93bdbe8746b02f0a42be91abcf.1375088734.git.petter@technux.se>
Download mbox | patch
Permalink /patch/54689/
State New
Headers show

Comments

Petter Mabäcker - July 29, 2013, 9:19 a.m.
Add a warning if 'bitbake -C' is executed with a task that does not
exist.

Fixes [YOCTO #4877]

Signed-off-by: Petter Mabäcker <petter@technux.se>
---
 bitbake/lib/bb/runqueue.py |    3 +++
 1 file changed, 3 insertions(+)
Paul Eggleton - July 29, 2013, 3:02 p.m.
Hi Petter,

On Monday 29 July 2013 11:19:31 Petter Mabäcker wrote:
> Add a warning if 'bitbake -C' is executed with a task that does not
> exist.
> 
> Fixes [YOCTO #4877]
> 
> Signed-off-by: Petter Mabäcker <petter@technux.se>
> ---
>  bitbake/lib/bb/runqueue.py |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
> index fce08ee..539e9af 100644
> --- a/bitbake/lib/bb/runqueue.py
> +++ b/bitbake/lib/bb/runqueue.py
> @@ -720,6 +720,9 @@ class RunQueueData:
> 
>          def invalidate_task(fn, taskname, error_nostamp):
>              taskdep = self.dataCache.task_deps[fn]
> +            fnid = self.taskData.getfn_id(fn)
> +            if taskname not in taskData.tasks_lookup[fnid]:
> +                logger.warn("Task %s does not exist, invalidate this task
> will have no effect" % taskname) if 'nostamp' in taskdep and taskname in
> taskdep['nostamp']: if error_nostamp:
>                      bb.fatal("Task %s is marked nostamp, cannot invalidate
> this task" % taskname)

This has now been merged with a slight tweak to the message and shortlog.

Thanks,
Paul

Patch

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index fce08ee..539e9af 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -720,6 +720,9 @@  class RunQueueData:
 
         def invalidate_task(fn, taskname, error_nostamp):
             taskdep = self.dataCache.task_deps[fn]
+            fnid = self.taskData.getfn_id(fn)
+            if taskname not in taskData.tasks_lookup[fnid]:
+                logger.warn("Task %s does not exist, invalidate this task will have no effect" % taskname)
             if 'nostamp' in taskdep and taskname in taskdep['nostamp']:
                 if error_nostamp:
                     bb.fatal("Task %s is marked nostamp, cannot invalidate this task" % taskname)