+ # find gcc and g++ compilers
+ if cc_version is not None:
+ factory.addStep(FileDownload(
+ mastersrc = "findbin.pl",
+ slavedest = "../findbin.pl",
+ mode = 0755))
+
+ factory.addStep(SetProperty(
+ name = "gcc",
+ property = "cc_command",
+ description = "Finding gcc command",
+ command = ["../findbin.pl", "gcc", cc_version[0], cc_version[1]],
+ haltOnFailure = True))
+
+ factory.addStep(SetProperty(
+ name = "g++",
+ property = "cxx_command",
+ description = "Finding g++ command",
+ command = ["../findbin.pl", "g++", cc_version[0], cc_version[1]],
+ haltOnFailure = True))
+
+ # expire tree if needed
+ if tree_expire > 0:
+ factory.addStep(FileDownload(
+ mastersrc = "expire.sh",
+ slavedest = "../expire.sh",
+ mode = 0755))
+
+ factory.addStep(ShellCommand(
+ name = "expire",
+ description = "Checking for build tree expiry",
+ command = ["./expire.sh", str(tree_expire)],
+ workdir = ".",
+ haltOnFailure = True,
+ timeout = 2400))
+
+ # user-requested clean targets
+ for tuple in CleanTargetMap:
+ factory.addStep(ShellCommand(
+ name = tuple[1],
+ description = 'User-requested "make %s"' % tuple[1],
+ command = ["make", tuple[1], "V=s"],
+ env = MakeEnv(),
+ doStepIf = IsCleanRequested(tuple[0])
+ ))
+
+ factory.addStep(MasterShellCommand(
+ name = "maketag",
+ description = "Tagging Git repository",
+ command = [home_dir+'/maketag.sh', '-i', '-k', str(gpg_keyid or ''),
+ '-p', str(gpg_passfile or ''), '-v', WithProperties("%(tag:-)s")],
+ path = home_dir+'/source.git',
+ env = {'GNUPGHOME': gpg_home},
+ haltOnFailure = True,
+ doStepIf = IsTaggingRequested,
+ locks = [tagLock.access('exclusive')]
+ ))
+
+ # switch to branch
+ factory.addStep(ShellCommand(
+ name = "switchbranch",
+ description = "Checking out Git branch",
+ command = "if [ -d .git ]; then git checkout '%s'; else exit 0; fi" % repo_branch,
+ haltOnFailure = True,
+ doStepIf = IsNoTaggingRequested
+ ))
+