summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-03-07 17:13:10 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-25 11:46:44 +0000
commit021942ba0b28fc23f825e1782645a0873b6c5b61 (patch)
treec7b81e9445cb6b24f4ad418b13165cf6dacc9ffd
parent6d1a33c01537f98cb90aac81ebcc4f15d8daa2e0 (diff)
downloadbuildstream-021942ba0b28fc23f825e1782645a0873b6c5b61.tar.gz
element.py: Add source cache as variable
Part of #440
-rw-r--r--buildstream/element.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 08cdac724..39b61cf5b 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -213,6 +213,7 @@ class Element(Plugin):
self.__weak_cache_key = None # Our cached weak cache key
self.__strict_cache_key = None # Our cached cache key for strict builds
self.__artifacts = context.artifactcache # Artifact cache
+ self.__sourcecache = context.sourcecache # Source cache
self.__consistency = Consistency.INCONSISTENT # Cached overall consistency state
self.__strong_cached = None # Whether we have a cached artifact
self.__weak_cached = None # Whether we have a cached artifact
@@ -2112,13 +2113,12 @@ class Element(Plugin):
def _fetch(self, fetch_original=False):
previous_sources = []
source = None
- sourcecache = self._get_context().sourcecache
# check whether the final source is cached
for source in self.sources():
pass
- if source and not fetch_original and sourcecache.contains(source):
+ if source and not fetch_original and self.__sourcecache.contains(source):
return
for source in self.sources():