phase1: remove dead code due to shared_wd=1
authorThibaut VARÈNE <hacks@slashdirt.org>
Thu, 20 Oct 2022 13:48:04 +0000 (15:48 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 15 May 2023 15:36:01 +0000 (17:36 +0200)
shared_wd is always set, the conditional on these bits were thus always
the same resulting in dead code.

Remove 'expire' config option which is no longer needed.

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

index 4cd05d9c0471f2445a1ddb0843d5494e445f2287..a006b561d13e1d899cf2435049b84cd455352b45 100644 (file)
@@ -8,7 +8,6 @@ buildbot_url = http://phase1.builds.openwrt.org/
 status_bind = tcp:8010:interface=127.0.0.1
 status_user = example
 status_password = example
-expire = 1209600
 port = 9989
 config_seed = # Seed configuration
        CONFIG_BUILDBOT=y
index 3bf9338325086c3fdd651d525f7b3f5ebaef376e..d2e09e1e1d8d610bbb593f9394263f25862e3b52 100644 (file)
@@ -205,7 +205,6 @@ c['prioritizeBuilders'] = prioritizeBuilders
 work_dir = os.path.abspath(ini['general'].get("workdir", "."))
 scripts_dir = os.path.abspath("../scripts")
 
-tree_expire = inip1.getint("expire", 0)
 config_seed = inip1.get("config_seed", "")
 
 repo_url = ini['repo'].get("url")
@@ -374,21 +373,6 @@ c['schedulers'].append(ForceScheduler(
 def IsSharedWorkdir(step):
        return bool(step.getProperty("shared_wd"))
 
-def IsCleanupRequested(step):
-       if IsSharedWorkdir(step):
-               return False
-       do_cleanup = step.getProperty("do_cleanup")
-       if do_cleanup:
-               return True
-       else:
-               return False
-
-def IsExpireRequested(step):
-       if IsSharedWorkdir(step):
-               return False
-       else:
-               return not IsCleanupRequested(step)
-
 def IsTaggingRequested(step):
        val = step.getProperty("tag")
        if val and re.match(r"^[0-9]+\.[0-9]+\.[0-9]+(?:-rc[0-9]+)?$", val):
@@ -566,50 +550,6 @@ for target in targets:
                warnOnFailure = False,
        ))
 
-       # expire tree if needed
-       if tree_expire > 0:
-               factory.addStep(FileDownload(
-                       name = "dlexpiresh",
-                       doStepIf = IsExpireRequested,
-                       mastersrc = scripts_dir + '/expire.sh',
-                       workerdest = "../expire.sh",
-                       mode = 0o755))
-
-               factory.addStep(ShellCommand(
-                       name = "expire",
-                       description = "Checking for build tree expiry",
-                       command = ["./expire.sh", str(tree_expire)],
-                       workdir = ".",
-                       haltOnFailure = True,
-                       doStepIf = IsExpireRequested,
-                       timeout = 2400))
-
-       # cleanup.sh if needed
-       factory.addStep(FileDownload(
-               name = "dlcleanupsh",
-               mastersrc = scripts_dir + '/cleanup.sh',
-               workerdest = "../cleanup.sh",
-               mode = 0o755,
-               doStepIf = IsCleanupRequested))
-
-       factory.addStep(ShellCommand(
-               name = "cleanold",
-               description = "Cleaning previous builds",
-               command = ["./cleanup.sh", c['buildbotURL'], Interpolate("%(prop:workername)s"), Interpolate("%(prop:buildername)s"), "full"],
-               workdir = ".",
-               haltOnFailure = True,
-               doStepIf = IsCleanupRequested,
-               timeout = 2400))
-
-       factory.addStep(ShellCommand(
-               name = "cleanup",
-               description = "Cleaning work area",
-               command = ["./cleanup.sh", c['buildbotURL'], Interpolate("%(prop:workername)s"), Interpolate("%(prop:buildername)s"), "single"],
-               workdir = ".",
-               haltOnFailure = True,
-               doStepIf = IsCleanupRequested,
-               timeout = 2400))
-
        # Workaround bug when switching from a checked out tag back to a branch
        # Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017809.html
        factory.addStep(ShellCommand(