summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-08-05 15:33:34 +0100
committerJames Ennis <james.ennis@codethink.co.uk>2019-08-05 15:33:34 +0100
commit39625d107a2ab546c649cfafa1ea152148c36e01 (patch)
tree25ca89b4f390db2180d742f0e6b38358a746365c
parent4f3c70b8e90ddd0bd87c301363fa3e0408d395e3 (diff)
downloadbuildstream-jennis/remove_cas_refs_heads.tar.gz
WIP: Remove cas/refs/heads related codejennis/remove_cas_refs_heads
-rw-r--r--src/buildstream/_cas/cascache.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py
index dbdfa41a8..2883ecbf0 100644
--- a/src/buildstream/_cas/cascache.py
+++ b/src/buildstream/_cas/cascache.py
@@ -83,8 +83,8 @@ class CASCache():
def __init__(self, path):
self.casdir = os.path.join(path, 'cas')
+ self.artifactsdir = os.path.join(path, 'artifacts')
self.tmpdir = os.path.join(path, 'tmp')
- os.makedirs(os.path.join(self.casdir, 'refs', 'heads'), exist_ok=True)
os.makedirs(os.path.join(self.casdir, 'objects'), exist_ok=True)
os.makedirs(self.tmpdir, exist_ok=True)
@@ -96,7 +96,8 @@ class CASCache():
# Preflight check.
#
def preflight(self):
- headdir = os.path.join(self.casdir, 'refs', 'heads')
+ headdir = os.path.join(self.artifactsdir, 'refs')
+ if not os.path.isdir(headdir):
objdir = os.path.join(self.casdir, 'objects')
if not (os.path.isdir(headdir) and os.path.isdir(objdir)):
raise CASCacheError("CAS repository check failed for '{}'".format(self.casdir))
@@ -708,7 +709,7 @@ class CASCache():
################################################
def _refpath(self, ref):
- return os.path.join(self.casdir, 'refs', 'heads', ref)
+ return os.path.join(self.artifactsdir, 'refs', ref)
# _remove_ref()
#