Skip to content

Commit

Permalink
cbuild: transitionally generate sha256-160 mkndx indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
nekopsykose committed Sep 21, 2024
1 parent 0c46d88 commit 7a6cb37
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/cbuild/apk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,17 @@ def build_index(repopath, epoch, allow_untrusted=False):
(repopath / "APKINDEX.tar.gz").unlink()
return True

# this is very dirty, but we need to use a sha1-length truncated hash with
# newer apk mkndx, as old apk has a bug where it cannot handle the full
# sha256 hash.
# at the same time, old mkndx also doesn't have this arg- so we need to check
# for it first.
# https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/11020
# remove this once we don't care about old apk anymore
help_output = call("mkndx", ["--help"], None, capture_output=True)
if "--hash HASH" in str(help_output.stdout):
aargs += ["--hash", "sha256-160"]

signr = call(
"mkndx",
aargs,
Expand Down

0 comments on commit 7a6cb37

Please sign in to comment.