From: Jo-Philipp Wich Date: Fri, 4 Nov 2016 14:59:50 +0000 (+0100) Subject: phase1: remove automatic triggering of clean targets X-Git-Tag: v1~238 X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=49d9859c052b95ce157d31eaf2906e32869522ad;p=buildbot.git phase1: remove automatic triggering of clean targets Remove the automatic triggering of clean targets depending on the changed files since the code for that is incompatible with BuildBot 0.8.9. Instead, implement the ability to trigger specific clean steps through build properties. Signed-off-by: Jo-Philipp Wich --- diff --git a/phase1/master.cfg b/phase1/master.cfg index 6030def..f92a080 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -141,23 +141,23 @@ from buildbot.steps.master import MasterShellCommand from buildbot.process.properties import WithProperties -MakeTargetMap = { - "^tools/": "tools/clean", - "^toolchain/": "toolchain/clean", - "^target/linux/": "target/linux/clean", - "^(config|include)/": "dirclean" -} +CleanTargetMap = [ + [ "tools", "tools/clean" ], + [ "chain", "toolchain/clean" ], + [ "linux", "target/linux/clean" ], + [ "dir", "dirclean" ], + [ "dist", "distclean" ] +] -def IsAffected(pattern): - def CheckAffected(change): - for request in change.build.requests: - for source in request.sources: - for change in source.changes: - for file in change.files: - if re.match(pattern, file): - return True - return False - return CheckAffected +def IsCleanRequested(pattern): + def CheckCleanProperty(step): + val = step.getProperty("clean") + if val and re.match(pattern, val): + return True + else: + return False + + return CheckCleanProperty c['builders'] = [] @@ -249,6 +249,16 @@ for target in targets: haltOnFailure = True, timeout = 2400)) + # user-requested clean targets + else: + for tuple in CleanTargetMap: + factory.addStep(ShellCommand( + name = tuple[1], + description = 'User-requested "make %s"' % tuple[1], + command = ["make", tuple[1], "V=s"], + doStepIf = IsCleanRequested(tuple[0]) + )) + # check out the source factory.addStep(Git(repourl=repo_url, mode='update')) @@ -361,14 +371,6 @@ EOT''' %(ts[0], ts[0], ts[1]) )) command=["make", "package/base-files/clean", "V=s"] )) - # optional clean steps - for pattern, maketarget in MakeTargetMap.items(): - factory.addStep(ShellCommand( - name = maketarget, - description = maketarget, - command=["make", maketarget, "V=s"], doStepIf=IsAffected(pattern) - )) - # build factory.addStep(ShellCommand( name = "tools",