from buildbot.steps.shell import SetProperty
from buildbot.steps.transfer import FileUpload
from buildbot.steps.transfer import FileDownload
+from buildbot.steps.transfer import StringDownload
from buildbot.steps.master import MasterShellCommand
from buildbot.process.properties import WithProperties
def GetDirectorySuffix(props):
- if props.hasProperty("slavename") and re.match("^[^-]+-[0-9]+\.[0-9]+-[^-]+$", props["slavename"]):
- return "-%s" % props["slavename"].split('-')[1]
- else:
- return ""
+ verpat = re.compile('^([0-9]{2})\.([0-9]{2})(?:\.([0-9]+)(?:-rc([0-9]+))?|-(SNAPSHOT))$')
+ if props.hasProperty("release_version"):
+ m = verpat.match(props["release_version"])
+ if m is not None:
+ return "-%02d.%02d" %(int(m.group(1)), int(m.group(2)))
+ return ""
def GetNumJobs(props):
if props.hasProperty("slavename") and props.hasProperty("nproc"):
command = "rsync --checksum -av sdk_update/ sdk/ && rm -rf sdk_update",
haltOnFailure = True))
+ factory.addStep(StringDownload(
+ name = "writeversionmk",
+ s = 'TOPDIR:=${CURDIR}\n\ninclude $(TOPDIR)/include/version.mk\n\nversion:\n\t@echo $(VERSION_NUMBER)\n',
+ slavedest = "sdk/getversion.mk",
+ mode = 0755))
+
+ factory.addStep(SetProperty(
+ name = "getversion",
+ property = "release_version",
+ description = "Finding SDK release version",
+ workdir = "build/sdk",
+ command = ["make", "-f", "getversion.mk"]))
+
factory.addStep(FileDownload(mastersrc=home_dir+'/key-build', slavedest="sdk/key-build", mode=0600))
factory.addStep(FileDownload(mastersrc=home_dir+'/key-build.pub', slavedest="sdk/key-build.pub", mode=0600))