return bool(IsKmodArchiveEnabled(step) and branches[branch].get("bin_url"))
+def IsRemoteShaSumsAvailable(step):
+ return step.getProperty("have_remote_shasums")
+
+
def GetBaseVersion(branch):
if re.match(r"^[^-]+-[0-9]+\.[0-9]+$", branch):
return branch.split("-")[1]
)
)
+ # download remote sha256sums to 'target-sha256sums'
+ factory.addStep(
+ ShellCommandAndSetProperty(
+ name="target-sha256sums",
+ description="Fetching remote sha256sums for target",
+ descriptionDone="Remote sha256sums for target fetched",
+ command=["rsync", Interpolate("-z%(prop:rsync_ipv4:+4)s")]
+ + rsync_defopts
+ + [
+ Interpolate(
+ "%(kw:url)s/%(kw:prefix)stargets/%(kw:target)s/%(kw:subtarget)s/sha256sums",
+ url=GetRsyncParams.withArgs("bin", "url"),
+ target=target,
+ subtarget=subtarget,
+ prefix=GetVersionPrefix,
+ ),
+ "target-sha256sums",
+ ],
+ env={
+ "RSYNC_PASSWORD": Interpolate(
+ "%(kw:key)s", key=GetRsyncParams.withArgs("bin", "key")
+ )
+ },
+ property="have_remote_shasums",
+ logEnviron=False,
+ haltOnFailure=False,
+ flunkOnFailure=False,
+ warnOnFailure=False,
+ doStepIf=util.Transform(bool, GetRsyncParams.withArgs("bin", "url")),
+ )
+ )
+
+ factory.addStep(
+ ShellCommand(
+ name="target-sha256sums_kmodsparse",
+ description="Extract kmods from remote sha256sums",
+ descriptionDone="Kmods extracted",
+ command="sed \"/ \\*kmods\\//! d\" target-sha256sums | tee target-sha256sums-kmods",
+ haltOnFailure=False,
+ doStepIf=IsRemoteShaSumsAvailable,
+ )
+ )
+
+ factory.addStep(
+ ShellCommand(
+ name="mergesha256sum",
+ description="Merge sha256sums kmods with sha256sums",
+ descriptionDone="Sha256sums merged",
+ command=[
+ "sort",
+ "-t", " ",
+ "-k", 2,
+ "-u",
+ Interpolate(
+ "bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/sha256sums",
+ target=target,
+ subtarget=subtarget,
+ ),
+ "target-sha256sums-kmods",
+ "-o",
+ Interpolate(
+ "bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/sha256sums",
+ target=target,
+ subtarget=subtarget,
+ ),
+ ],
+ env={"LC_ALL": "C"},
+ haltOnFailure=False,
+ doStepIf=IsRemoteShaSumsAvailable,
+ )
+ )
+
# sign
factory.addStep(
MasterShellCommand(
)
)
- # download remote sha256sums to 'target-sha256sums'
- factory.addStep(
- ShellCommand(
- name="target-sha256sums",
- description="Fetching remote sha256sums for target",
- descriptionDone="Remote sha256sums for target fetched",
- command=["rsync", Interpolate("-z%(prop:rsync_ipv4:+4)s")]
- + rsync_defopts
- + [
- Interpolate(
- "%(kw:url)s/%(kw:prefix)stargets/%(kw:target)s/%(kw:subtarget)s/sha256sums",
- url=GetRsyncParams.withArgs("bin", "url"),
- target=target,
- subtarget=subtarget,
- prefix=GetVersionPrefix,
- ),
- "target-sha256sums",
- ],
- env={
- "RSYNC_PASSWORD": Interpolate(
- "%(kw:key)s", key=GetRsyncParams.withArgs("bin", "key")
- )
- },
- logEnviron=False,
- haltOnFailure=False,
- flunkOnFailure=False,
- warnOnFailure=False,
- doStepIf=util.Transform(bool, GetRsyncParams.withArgs("bin", "url")),
- )
- )
-
# build list of files to upload
factory.addStep(
FileDownload(