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, '<hex> <path>'. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
551bfcdcd6
commit
8429ae7e8a
1 file changed
+10
-1
+10
-1
@@ -48,8 +48,17 @@ mkdir -p "$tmpd"
|
||||
# One line per file: "<sha256> <path>", 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 "<hex> <path>" 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
|
||||
|
||||
Reference in new issue
Block a user