[bitbake-devel] [PATCH] bb.build: let addtask undo a deltask

Christopher Larson kergoth at gmail.com
Fri Jul 31 17:31:33 UTC 2015


From: Christopher Larson <chris_larson at mentor.com>

While we're in that part of the code, also fix 'not foo in bar' to 'foo not in
bar', as is preferred in python.

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
 lib/bb/build.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/bb/build.py b/lib/bb/build.py
index 764163f..866056b 100644
--- a/lib/bb/build.py
+++ b/lib/bb/build.py
@@ -736,9 +736,14 @@ def addtask(task, before, after, d):
     if task[:3] != "do_":
         task = "do_" + task
 
+    deltasks = d.getVar('__BBDELTASKS', False)
+    if deltasks and task in deltasks:
+        deltasks.remove(task)
+        d.setVar('__BBDELTASKS', deltasks)
+
     d.setVarFlag(task, "task", 1)
     bbtasks = d.getVar('__BBTASKS', False) or []
-    if not task in bbtasks:
+    if task not in bbtasks:
         bbtasks.append(task)
     d.setVar('__BBTASKS', bbtasks)
 
@@ -761,7 +766,7 @@ def deltask(task, d):
         task = "do_" + task
 
     bbtasks = d.getVar('__BBDELTASKS', False) or []
-    if not task in bbtasks:
+    if task not in bbtasks:
         bbtasks.append(task)
     d.setVar('__BBDELTASKS', bbtasks)
 
-- 
2.2.1




More information about the bitbake-devel mailing list