summaryrefslogtreecommitdiff
path: root/buildstream/_artifactcache.py
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-02-28 15:13:38 +0000
committerJürg Billeter <j@bitron.ch>2019-03-14 07:12:34 +0000
commit6a1e74619e0009ca5611bba025b8dcf08bec353e (patch)
treec75f062f36ebf71556cc5ed3dbe78d1f0b4693ec /buildstream/_artifactcache.py
parent5de8de8ec76609c3eb3a75443d2566b55c29b440 (diff)
downloadbuildstream-6a1e74619e0009ca5611bba025b8dcf08bec353e.tar.gz
Integrate source cache with rest of buildstream
This involve introducing new Consistency states `STAGED` and `BOTH` that represent when the source is just in the local CAS and in both the local CAS and unstaged in the source directory. Sources are staged for each element into the local CAS during the fetch stage. If the sources are in the local consistency state `STAGED` when wanting to open a workspace, the original sources are fetched. Relavant tests this affects have been changed. Part of #440
Diffstat (limited to 'buildstream/_artifactcache.py')
-rw-r--r--buildstream/_artifactcache.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/buildstream/_artifactcache.py b/buildstream/_artifactcache.py
index e04648bee..49f07cb50 100644
--- a/buildstream/_artifactcache.py
+++ b/buildstream/_artifactcache.py
@@ -58,7 +58,7 @@ class ArtifactCache(BaseCache):
self._required_elements = set() # The elements required for this session
self.casquota.add_ref_callbacks(self.required_artifacts())
- self.casquota.add_remove_callbacks((lambda x: not x.startswith('sources/'), self.remove))
+ self.casquota.add_remove_callbacks((lambda x: not x.startswith('@'), self.remove))
# mark_required_elements():
#
@@ -178,7 +178,9 @@ class ArtifactCache(BaseCache):
# ([str]) - A list of artifact names as generated in LRU order
#
def list_artifacts(self, *, glob=None):
- return self.cas.list_refs(glob=glob)
+ return list(filter(
+ lambda x: not x.startswith('@'),
+ self.cas.list_refs(glob=glob)))
# remove():
#