diff options
Diffstat (limited to 'src/buildstream/element.py')
-rw-r--r-- | src/buildstream/element.py | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py index e35192d84..764dfe1bc 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -264,7 +264,6 @@ class Element(Plugin): self.__consistency = Consistency.INCONSISTENT # Cached overall consistency state self.__assemble_scheduled = False # Element is scheduled to be assembled self.__assemble_done = False # Element is assembled - self.__tracking_scheduled = False # Sources are scheduled to be tracked self.__pull_done = False # Whether pull was attempted self.__cached_successfully = None # If the Element is known to be successfully cached self.__source_cached = None # If the sources are known to be successfully cached @@ -1331,32 +1330,24 @@ class Element(Plugin): # and reinterrogation of element state after tracking of elements # succeeds. # - # This method should return the value of `__tracking_scheduled` to callers - # that the element was marked for tracking. - # - # If `__tracking_scheduled` is not already determined then set it to `True` - # if at least one source advertises that it can be tracked. + # This method should return a boolean indicating whether the element can + # be tracked. This is `True` if at least one source advertises that it can + # be tracked and `False` otherwise. # # Returns: - # (bool): value of the `__tracking_scheduled` attribute + # (bool): if any source is trackable # def _schedule_tracking(self) -> bool: - # if the tracking schedule is already determined then this can be skipped - if self.__tracking_scheduled is None: - # Tracking does not make sense in cases where no sources can be tracked. - if any(source.is_trackable() for source in self.__sources): - self.__tracking_scheduled = True - return self.__tracking_scheduled + if any(source.is_trackable() for source in self.__sources): + return True + return False # _tracking_done(): # # This is called in the main process after the element has been tracked # def _tracking_done(self): - assert self.__tracking_scheduled - - self.__tracking_scheduled = False - + # FIXME: avoid unnecessary work here self._update_state() # _track(): @@ -2392,10 +2383,6 @@ class Element(Plugin): # def __update_source_state(self): - # Cannot resolve source state until tracked - if self.__tracking_scheduled: - return - self.__consistency = Consistency.CACHED workspace = self._get_workspace() |