diff options
author | Carl Dong <contact@carldong.me> | 2021-04-12 12:21:00 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-05-03 13:18:19 -0400 |
commit | b5fd89c4c89136007429688601ce4fa497f5f09e (patch) | |
tree | 44a53b9f9823c70f4011b6b568eb9f072ce350d6 | |
parent | 5926432ba68ba154df6c8eaa74adb18cc0123167 (diff) |
guix-attest: Only use cross-platform flags for find+xargs
-rwxr-xr-x | contrib/guix/guix-attest | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/guix/guix-attest b/contrib/guix/guix-attest index d7604dd75f..fbb4b73c71 100755 --- a/contrib/guix/guix-attest +++ b/contrib/guix/guix-attest @@ -145,7 +145,13 @@ for outdir in "${OUTDIRS[@]}"; do echo "${outname}: Hashing build outputs to produce SHA256SUMS" ( cd "$outdir" - find . -type f -printf '%P\0' | env LC_ALL=C sort -z | xargs -r0 sha256sum >> "$outsigdir"/SHA256SUMS + files="$(find . -type f)" + if [ -n "$files" ]; then + cut -c3- <<< "$files" | env LC_ALL=C sort | xargs sha256sum >> "$outsigdir"/SHA256SUMS + else + echo "ERR: ${outname}: No outputs found in '${outdir}'" + exit 1 + fi ) echo "${outname}: Signing SHA256SUMS to produce SHA256SUMS.asc" gpg --detach-sign --local-user "$gpg_key_name" --output "$outsigdir"/SHA256SUMS.asc "$outsigdir"/SHA256SUMS |