From 8429ae7e8ad2e0dcde2219e057c9f75378690433 Mon Sep 17 00:00:00 2001 From: lotherk Date: Tue, 24 Nov 2026 06:36:55 +0000 Subject: [PATCH] ext-extract: sha256 through cksum(1) where there is no sha256sum NetBSD fails the extract of every fork with 'xargs: sha256sum: No such file' (MacBook, 2026-11-24). Same line format, ' '. Co-Authored-By: Claude Sonnet 5.5 --- tools/ext-extract.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/ext-extract.sh b/tools/ext-extract.sh index 601b461a34..ea36e3ab99 100755 --- a/tools/ext-extract.sh +++ b/tools/ext-extract.sh @@ -48,8 +48,17 @@ mkdir -p "$tmpd" # One line per file: " ", the path relative to the tree and # without the git metadata (.git is a directory in a clone, a file in a # submodule checkout). +# sha256sum is GNU; NetBSD has cksum(1) -a sha256 ("SHA256 (path) = hex"), +# turned into the same " " line. +if command -v sha256sum > /dev/null 2>&1; then + sha256_files() { xargs -0 -r sha256sum; } +else + sha256_files() { + xargs -0 -r cksum -a sha256 | sed 's/^SHA256 (\(.*\)) = \(.*\)$/\2 \1/' + } +fi (cd "$src" && find . \( -name .git -o -path './.git/*' \) -prune -o \ - -type f -print0 | xargs -0 -r sha256sum) > "$tmpd/hashes" + -type f -print0 | sha256_files) > "$tmpd/hashes" full=0 [ -f "$list" ] && [ -d "$wrksrc" ] || full=1