]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
build: delete tasks thoroughly
authorChristopher Larson <chris_larson@mentor.com>
Mon, 3 Aug 2015 19:20:43 +0000 (12:20 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 1 Sep 2015 19:45:41 +0000 (20:45 +0100)
We want addtask to be able to bring back a deleted task, but we don't want its
previous dependencies to come back with it, so rather than marking a task as
deleted and then skipping tasks marked as such, actually delete the task and
its dependency information in deltask.

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

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/build.py
lib/bb/parse/ast.py

index 764163f37f82252d2fcafe4d86d15f18adc6f145..948c3951f4e3957f6a2bb5cac79773dbf50b09e5 100644 (file)
@@ -686,7 +686,7 @@ def stampfile(taskname, d, file_name = None):
     """
     return stamp_internal(taskname, d, file_name)
 
-def add_tasks(tasklist, deltasklist, d):
+def add_tasks(tasklist, d):
     task_deps = d.getVar('_task_deps', False)
     if not task_deps:
         task_deps = {}
@@ -698,9 +698,6 @@ def add_tasks(tasklist, deltasklist, d):
     for task in tasklist:
         task = d.expand(task)
 
-        if task in deltasklist:
-            continue
-
         d.setVarFlag(task, 'task', 1)
 
         if not task in task_deps['tasks']:
@@ -738,7 +735,7 @@ def addtask(task, before, after, d):
 
     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)
 
@@ -760,8 +757,14 @@ def deltask(task, d):
     if task[:3] != "do_":
         task = "do_" + task
 
-    bbtasks = d.getVar('__BBDELTASKS', False) or []
-    if not task in bbtasks:
-        bbtasks.append(task)
-    d.setVar('__BBDELTASKS', bbtasks)
-
+    bbtasks = d.getVar('__BBTASKS', False) or []
+    if task in bbtasks:
+        bbtasks.remove(task)
+        d.setVar('__BBTASKS', bbtasks)
+
+    d.delVarFlag(task, 'deps')
+    for bbtask in d.getVar('__BBTASKS', False) or []:
+        deps = d.getVarFlag(bbtask, 'deps') or []
+        if task in deps:
+            deps.remove(task)
+            d.setVarFlag(bbtask, 'deps', deps)
index bd42bd3a7ae1868ebd85eea030dd9313fe0f0648..11db1801b31709aa17119814f5ad50d7587d0cc0 100644 (file)
@@ -330,8 +330,7 @@ def finalize(fn, d, variant = None):
     bb.data.update_data(d)
 
     tasklist = d.getVar('__BBTASKS', False) or []
-    deltasklist = d.getVar('__BBDELTASKS', False) or []
-    bb.build.add_tasks(tasklist, deltasklist, d)
+    bb.build.add_tasks(tasklist, d)
 
     bb.parse.siggen.finalise(fn, d, variant)