diff options
-rw-r--r-- | buildstream/_artifactcache.py | 3 | ||||
-rw-r--r-- | buildstream/_cas/cascache.py | 5 | ||||
-rw-r--r-- | buildstream/_sourcecache.py | 4 | ||||
-rw-r--r-- | buildstream/element.py | 17 |
4 files changed, 10 insertions, 19 deletions
diff --git a/buildstream/_artifactcache.py b/buildstream/_artifactcache.py index a42e2dd7f..e40ba54c6 100644 --- a/buildstream/_artifactcache.py +++ b/buildstream/_artifactcache.py @@ -312,13 +312,12 @@ class ArtifactCache(BaseCache): # Args: # element (Element): The Element whose artifact is to be fetched # key (str): The cache key to use - # progress (callable): The progress callback, if any # pull_buildtrees (bool): Whether to pull buildtrees or not # # Returns: # (bool): True if pull was successful, False if artifact was not available # - def pull(self, element, key, *, progress=None, pull_buildtrees=False): + def pull(self, element, key, *, pull_buildtrees=False): display_key = key[:self.context.log_key_length] project = element._get_project() diff --git a/buildstream/_cas/cascache.py b/buildstream/_cas/cascache.py index 0bdb2062d..6d76de14a 100644 --- a/buildstream/_cas/cascache.py +++ b/buildstream/_cas/cascache.py @@ -251,14 +251,11 @@ class CASCache(): # Args: # ref (str): The ref to pull # remote (CASRemote): The remote repository to pull from - # progress (callable): The progress callback, if any - # subdir (str): The optional specific subdir to pull - # excluded_subdirs (list): The optional list of subdirs to not pull # # Returns: # (bool): True if pull was successful, False if ref was not available # - def pull(self, ref, remote, *, progress=None): + def pull(self, ref, remote): try: remote.init() diff --git a/buildstream/_sourcecache.py b/buildstream/_sourcecache.py index ecd02349e..282809572 100644 --- a/buildstream/_sourcecache.py +++ b/buildstream/_sourcecache.py @@ -185,7 +185,7 @@ class SourceCache(BaseCache): # # Returns: # (bool): True if pull successful, False if not - def pull(self, source, *, progress=None): + def pull(self, source): ref = source._get_source_name() project = source._get_project() @@ -196,7 +196,7 @@ class SourceCache(BaseCache): try: source.status("Pulling source {} <- {}".format(display_key, remote.spec.url)) - if self.cas.pull(ref, remote, progress=progress): + if self.cas.pull(ref, remote): source.info("Pulled source {} <- {}".format(display_key, remote.spec.url)) # no need to pull from additional remotes return True diff --git a/buildstream/element.py b/buildstream/element.py index 913f36b45..3a9281f68 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -1910,18 +1910,15 @@ class Element(Plugin): def _pull(self): context = self._get_context() - def progress(percent, message): - self.status(message) - # Get optional specific subdir to pull and optional list to not pull # based off of user context pull_buildtrees = context.pull_buildtrees # Attempt to pull artifact without knowing whether it's available - pulled = self.__pull_strong(progress=progress, pull_buildtrees=pull_buildtrees) + pulled = self.__pull_strong(pull_buildtrees=pull_buildtrees) if not pulled and not self._cached() and not context.get_strict(): - pulled = self.__pull_weak(progress=progress, pull_buildtrees=pull_buildtrees) + pulled = self.__pull_weak(pull_buildtrees=pull_buildtrees) if not pulled: return False @@ -2860,11 +2857,10 @@ class Element(Plugin): # Returns: # (bool): Whether or not the pull was successful # - def __pull_strong(self, *, progress=None, pull_buildtrees): + def __pull_strong(self, *, pull_buildtrees): weak_key = self._get_cache_key(strength=_KeyStrength.WEAK) key = self.__strict_cache_key - if not self.__artifacts.pull(self, key, progress=progress, - pull_buildtrees=pull_buildtrees): + if not self.__artifacts.pull(self, key, pull_buildtrees=pull_buildtrees): return False # update weak ref by pointing it to this newly fetched artifact @@ -2878,16 +2874,15 @@ class Element(Plugin): # the weak cache key # # Args: - # progress (callable): The progress callback, if any # subdir (str): The optional specific subdir to pull # excluded_subdirs (list): The optional list of subdirs to not pull # # Returns: # (bool): Whether or not the pull was successful # - def __pull_weak(self, *, progress=None, pull_buildtrees): + def __pull_weak(self, *, pull_buildtrees): weak_key = self._get_cache_key(strength=_KeyStrength.WEAK) - if not self.__artifacts.pull(self, weak_key, progress=progress, + if not self.__artifacts.pull(self, weak_key, pull_buildtrees=pull_buildtrees): return False |