phase1: don't expire the tree if cleanup is requested
authorThibaut VARÈNE <hacks@slashdirt.org>
Thu, 21 Jun 2018 10:22:00 +0000 (12:22 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 26 Jun 2018 20:08:40 +0000 (22:08 +0200)
expire.sh will wipe the git repository, which is unnecessary and
adds overhead (redownload) if cleanup is already enacted.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
phase1/master.cfg

index cb0e70910fba9a7fdadc5e2d9c131bdd9772e745..5f7ca8ebf493f5919e3c19c8c3aefa070f573038 100644 (file)
@@ -235,6 +235,9 @@ def IsCleanupRequested(step):
        else:
                return False
 
+def IsExpireRequested(step):
+       return not IsCleanupRequested(step)
+
 def IsTaggingRequested(step):
        val = step.getProperty("tag")
        if val and re.match("^[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", val):
@@ -430,6 +433,7 @@ for target in targets:
        # expire tree if needed
        if tree_expire > 0:
                factory.addStep(FileDownload(
+                       doStepIf = IsExpireRequested,
                        mastersrc = "expire.sh",
                        slavedest = "../expire.sh",
                        mode = 0755))
@@ -440,6 +444,7 @@ for target in targets:
                        command = ["./expire.sh", str(tree_expire)],
                        workdir = ".",
                        haltOnFailure = True,
+                       doStepIf = IsExpireRequested,
                        timeout = 2400))
 
        # cleanup.sh if needed