summaryrefslogtreecommitdiff
path: root/ybd
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2017-09-07 16:25:11 +0100
committerBen Brown <ben.brown@codethink.co.uk>2017-09-07 16:26:07 +0100
commit0c3d787e171e36a25f13d0ac9b9c22b26b8853a2 (patch)
tree8842646fcecfd7115e64ce3da6da88a3786d81d3 /ybd
parent92ccf545c608507bb44138d2b10cb20c350fd869 (diff)
downloadybd-0c3d787e171e36a25f13d0ac9b9c22b26b8853a2.tar.gz
Filter .trees from artifacts for culling
Rather than saving after cull.
Diffstat (limited to 'ybd')
-rwxr-xr-xybd/__main__.py3
-rw-r--r--ybd/cache.py1
2 files changed, 2 insertions, 2 deletions
diff --git a/ybd/__main__.py b/ybd/__main__.py
index 7014280..5be770e 100755
--- a/ybd/__main__.py
+++ b/ybd/__main__.py
@@ -93,13 +93,12 @@ with timer('TOTAL'):
log('ARCH', 'No definitions for', config['arch'], exit=True)
write_cache_key()
+ app.defs.save_trees()
if config.get('mode', 'normal') == 'keys-only':
os._exit(0)
cache.cull(config['artifacts'])
- app.defs.save_trees()
-
sandbox.executor = sandboxlib.executor_for_platform()
log(config['target'], 'Sandbox using %s' % sandbox.executor)
if sandboxlib.chroot == sandbox.executor:
diff --git a/ybd/cache.py b/ybd/cache.py
index f3b312d..b12d0f3 100644
--- a/ybd/cache.py
+++ b/ybd/cache.py
@@ -324,6 +324,7 @@ def cull(artifact_dir):
def clear(deleted, artifact_dir):
artifacts = utils.sorted_ls(artifact_dir)
+ artifacts[:] = [a for a in artifacts if a != '.trees']
for artifact in artifacts:
stat = os.statvfs(artifact_dir)
free = stat.f_frsize * stat.f_bavail / 1000000000