Skip to content

Commit b5fd89c

Browse files
committed
guix-attest: Only use cross-platform flags for find+xargs
1 parent 5926432 commit b5fd89c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

contrib/guix/guix-attest

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,13 @@ for outdir in "${OUTDIRS[@]}"; do
145145
echo "${outname}: Hashing build outputs to produce SHA256SUMS"
146146
(
147147
cd "$outdir"
148-
find . -type f -printf '%P\0' | env LC_ALL=C sort -z | xargs -r0 sha256sum >> "$outsigdir"/SHA256SUMS
148+
files="$(find . -type f)"
149+
if [ -n "$files" ]; then
150+
cut -c3- <<< "$files" | env LC_ALL=C sort | xargs sha256sum >> "$outsigdir"/SHA256SUMS
151+
else
152+
echo "ERR: ${outname}: No outputs found in '${outdir}'"
153+
exit 1
154+
fi
149155
)
150156
echo "${outname}: Signing SHA256SUMS to produce SHA256SUMS.asc"
151157
gpg --detach-sign --local-user "$gpg_key_name" --output "$outsigdir"/SHA256SUMS.asc "$outsigdir"/SHA256SUMS

0 commit comments

Comments
 (0)