summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-06-13 17:58:22 +0200
committerJürg Billeter <j@bitron.ch>2019-08-20 07:41:23 +0200
commit4b82baa1a8c89a33f40bd20fbff10af4ec2dbbf2 (patch)
treef40cd67b0caea8c722d734480d8076e80e9984a5
parent54deb4be42bcbdefc52cbdd4da59de4d3305c700 (diff)
downloadbuildstream-4b82baa1a8c89a33f40bd20fbff10af4ec2dbbf2.tar.gz
cascache.py: Remove add_reachable_*_callback() methods
-rw-r--r--src/buildstream/_artifactcache.py39
-rw-r--r--src/buildstream/_cas/cascache.py11
-rw-r--r--src/buildstream/_sourcecache.py2
3 files changed, 0 insertions, 52 deletions
diff --git a/src/buildstream/_artifactcache.py b/src/buildstream/_artifactcache.py
index 7e245fbfa..736a98b27 100644
--- a/src/buildstream/_artifactcache.py
+++ b/src/buildstream/_artifactcache.py
@@ -102,9 +102,6 @@ class ArtifactCache(BaseCache):
self.artifactdir = context.artifactdir
os.makedirs(self.artifactdir, exist_ok=True)
- self.cas.add_reachable_directories_callback(self._reachable_directories)
- self.cas.add_reachable_digests_callback(self._reachable_digests)
-
# mark_required_elements():
#
# Mark elements whose artifacts are required for the current run.
@@ -459,42 +456,6 @@ class ArtifactCache(BaseCache):
# Local Private Methods #
################################################
- # _reachable_directories()
- #
- # Returns:
- # (iter): Iterator over directories digests available from artifacts.
- #
- def _reachable_directories(self):
- for root, _, files in os.walk(self.artifactdir):
- for artifact_file in files:
- artifact = artifact_pb2.Artifact()
- with open(os.path.join(root, artifact_file), 'r+b') as f:
- artifact.ParseFromString(f.read())
-
- if str(artifact.files):
- yield artifact.files
-
- if str(artifact.buildtree):
- yield artifact.buildtree
-
- # _reachable_digests()
- #
- # Returns:
- # (iter): Iterator over single file digests in artifacts
- #
- def _reachable_digests(self):
- for root, _, files in os.walk(self.artifactdir):
- for artifact_file in files:
- artifact = artifact_pb2.Artifact()
- with open(os.path.join(root, artifact_file), 'r+b') as f:
- artifact.ParseFromString(f.read())
-
- if str(artifact.public_data):
- yield artifact.public_data
-
- for log_file in artifact.logs:
- yield log_file.digest
-
# _push_artifact()
#
# Pushes relevant directories and then artifact proto to remote.
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py
index 40023ff01..4a73cb2ee 100644
--- a/src/buildstream/_cas/cascache.py
+++ b/src/buildstream/_cas/cascache.py
@@ -56,9 +56,6 @@ class CASCache():
os.makedirs(os.path.join(self.casdir, 'objects'), exist_ok=True)
os.makedirs(self.tmpdir, exist_ok=True)
- self.__reachable_directory_callbacks = []
- self.__reachable_digest_callbacks = []
-
# preflight():
#
# Preflight check.
@@ -456,14 +453,6 @@ class CASCache():
# Remove cache ref
self._remove_ref(ref, basedir)
- # adds callback of iterator over reachable directory digests
- def add_reachable_directories_callback(self, callback):
- self.__reachable_directory_callbacks.append(callback)
-
- # adds callbacks of iterator over reachable file digests
- def add_reachable_digests_callback(self, callback):
- self.__reachable_digest_callbacks.append(callback)
-
def update_tree_mtime(self, tree):
reachable = set()
self._reachable_refs_dir(reachable, tree, update_mtime=True)
diff --git a/src/buildstream/_sourcecache.py b/src/buildstream/_sourcecache.py
index bc5fad71b..1444f538d 100644
--- a/src/buildstream/_sourcecache.py
+++ b/src/buildstream/_sourcecache.py
@@ -98,8 +98,6 @@ class SourceCache(BaseCache):
self.sourcerefdir = os.path.join(context.cachedir, 'source_protos')
os.makedirs(self.sourcerefdir, exist_ok=True)
- self.cas.add_reachable_directories_callback(self._reachable_directories)
-
# mark_required_sources()
#
# Mark sources that are required by the current run.