[tests] Fix uploadcheck for BSD (providing sha1 instead of sha1sum)

personal/stbuehler/wip
Stefan Bühler 9 years ago
parent bfa1395937
commit 4cdda3fb1e
  1. 13
      tests/t-cgi.py

@ -31,9 +31,18 @@ printf '%s' "${val}"
SCRIPT_UPLOADCHECK="""#!/bin/sh
printf 'Status: 200\\r\\nContent-Type: text/plain\\r\\n\\r\\n'
SHA1SUM=$(which sha1sum sha1)
if [ ! -x "${SHA1SUM}" ]; then
printf 'Status: 404\r\nContent-Type: text/plain\r\n\r\n'
printf "Couldn't find sha1sum nor sha1; can't calculate upload checksum"
echo >&2 "Couldn't find sha1sum nor sha1; can't calculate upload checksum"
exit 1
fi
printf 'Status: 200\r\nContent-Type: text/plain\r\n\r\n'
csum=`sha1sum | cut -d' ' -f1`
csum=`"${SHA1SUM}" | cut -d' ' -f1`
printf '%s' "${csum}"
"""

Loading…
Cancel
Save