|
|
@@ -70,7 +70,9 @@ def write_inner_sums(stage: Path) -> None:
|
|
|
if path.is_file() and path.name != "SHA256SUMS"
|
|
|
)
|
|
|
lines = [f"{sha256(stage / name)} {name}" for name in names]
|
|
|
- (stage / "SHA256SUMS").write_text("\n".join(lines) + "\n", encoding="ascii")
|
|
|
+ # Write bytes so a Windows build host cannot turn Linux checksum records
|
|
|
+ # into CRLF and make sha256sum parse the filename incorrectly.
|
|
|
+ (stage / "SHA256SUMS").write_bytes(("\n".join(lines) + "\n").encode("ascii"))
|
|
|
|
|
|
|
|
|
def add_tree(tar: tarfile.TarFile, stage: Path, top: str) -> None:
|
|
|
@@ -164,7 +166,7 @@ def main() -> int:
|
|
|
create_archive(stage, archive, top)
|
|
|
digest = sha256(archive)
|
|
|
outer_sum = archive.with_suffix(archive.suffix + ".sha256")
|
|
|
- outer_sum.write_text(f"{digest} {archive.name}\n", encoding="ascii")
|
|
|
+ outer_sum.write_bytes(f"{digest} {archive.name}\n".encode("ascii"))
|
|
|
print(f"archive={archive}")
|
|
|
print(f"sha256={digest}")
|
|
|
print(f"source_commit={source_commit}")
|