diff options
-rw-r--r-- | src/buildstream/_pipeline.py | 16 | ||||
-rw-r--r-- | src/buildstream/_stream.py | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/buildstream/_pipeline.py b/src/buildstream/_pipeline.py index 4352df56c..440bd8bd3 100644 --- a/src/buildstream/_pipeline.py +++ b/src/buildstream/_pipeline.py @@ -319,6 +319,22 @@ class Pipeline(): if e not in subtract_set ] + # add_elements() + # + # Add to a list of elements all elements that are not already in it + # + # Args: + # elements (list of Element): The element list + # add (list of Element): List of elements to add + # + # Returns: + # (list): The original elements list, with elements in add that weren't + # already in it added. + def add_elements(self, elements, add): + ret = elements[:] + ret.extend(e for e in add if e not in ret) + return ret + # track_cross_junction_filter() # # Filters out elements which are across junction boundaries, diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index 594da997e..fcd40c3b4 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -180,7 +180,8 @@ class Stream(): self._message(MessageType.INFO, "Attempting to fetch missing or incomplete artifacts") self._scheduler.clear_queues() self._add_queue(PullQueue(self._scheduler)) - self._enqueue_plan([element] + missing_deps) + plan = self._pipeline.add_elements([element], missing_deps) + self._enqueue_plan(plan) self._run() buildtree = False |