summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/buildman/builder.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index 4a24f744fe2..da2a0a12813 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -1397,8 +1397,14 @@ class Builder:
for commit_upto in range(self.commit_count):
dir_list.append(self._GetOutputDir(commit_upto))
+ to_remove = []
for dirname in glob.glob(os.path.join(self.base_dir, '*')):
if dirname not in dir_list:
+ to_remove.append(dirname)
+ if to_remove:
+ Print('Removing %d old build directories' % len(to_remove),
+ newline=False)
+ for dirname in to_remove:
shutil.rmtree(dirname)
def BuildBoards(self, commits, board_selected, keep_outputs, verbose):