script/autobuild.py: cleanup the task subdirs when they're done.
authorStefan Metzmacher <metze@samba.org>
Wed, 11 Jan 2017 13:42:08 +0000 (14:42 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Jan 2017 14:35:13 +0000 (15:35 +0100)
This hopefully reduces the used space on the memdisk.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
script/autobuild.py

index ead6319de7587d5a91a70a47ead37df06a4fa602..ddf02aba3a662c18c6626378168d6c231ca09d27 100755 (executable)
@@ -279,6 +279,7 @@ class builder(object):
         self.sdir = "%s/%s" % (testbase, self.tag)
         self.prefix = "%s/%s" % (test_prefix, self.tag)
         run_cmd("rm -rf %s" % self.sdir)
+        run_cmd("rm -rf %s" % self.prefix)
         if cp:
             run_cmd("cp --recursive --link --archive %s %s" % (test_master, self.sdir), dir=test_master, show=True)
         else:
@@ -287,6 +288,9 @@ class builder(object):
 
     def start_next(self):
         if self.next == len(self.sequence):
+            if not options.nocleanup:
+                run_cmd("rm -rf %s" % self.sdir)
+                run_cmd("rm -rf %s" % self.prefix)
             print '%s: Completed OK' % self.name
             self.done = True
             return