]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
buildman: Print a message when removing old directories
authorSimon Glass <sjg@chromium.org>
Sun, 18 Sep 2016 22:48:32 +0000 (16:48 -0600)
committersjg <sjg@chromium.org>
Sun, 9 Oct 2016 15:30:32 +0000 (09:30 -0600)
When buildman starts, it prepares its output directory by removing any old
build directories which will not be used this time. This can happen if a
previous build left directories around for commit hashes which are no-longer
part of the branch.

This can take quite a while, so print a message to indicate what is going
on.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/builder.py

index 4a24f744fe2ab51aa6130a8d02dc6779d054386e..da2a0a128133161d95916dd570fe2ad63d3b2608 100644 (file)
@@ -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):