package/e2fsprogs: update to 1.42.12, add subpackages for static tune2fs and e2fsck
[openadk.git] / scripts / sha256sum
blob2a7ffb6f7ee711ccf738124f4ea0dc8dcf30053c
1 #!/usr/bin/env bash
2 # This file is part of the OpenADK project. OpenADK is copyrighted
3 # material, please see the LICENCE file in the top-level directory.
5 if [ -x /usr/bin/sha256sum ]; then
6 /usr/bin/sha256sum "$@"
7 elif [ -x /bin/cksum ] && [ $(echo | cksum -a sha256) = 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b ]; then
8 # we assume the arguments are exactly "-c" or "-c -"
9 x=$(sed 's/^\([0-9a-fA-F]*\) *\([^ ].*\)$/SHA256 (\2) = \1/' | cksum -c -a sha256)
10 [[ $x = *FAILED* ]] && exit 1
11 exit 0
12 else
13 tmp=$(mktemp -t yyy)
14 cat - > $tmp
15 shasum -a 256 "$@" $tmp