summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorAaron Bockover <aaron@abock.org>2011-03-24 14:52:08 -0400
committerAaron Bockover <aaron@abock.org>2011-03-24 14:52:08 -0400
commit2eb8cc318734f59cf2a076c0de1cd839d8e9b177 (patch)
tree5030509597c3d9fcc2749fc6fb4a0d121a740c84 /extras
parent2a392b4a8864ae3d6907ec016786ca14dce8dab3 (diff)
Ensure sha256 sum output is consistent
On FreeBSD sha256 outputs in <sum><space><file> format but this is invalid. Darwin and Linux output in <sum><space><space><file> format. This commit supports Darwin (shasum -a 256) and also forces the proper formatting through awk.
Diffstat (limited to 'extras')
-rwxr-xr-xextras/make-release10
1 files changed, 9 insertions, 1 deletions
diff --git a/extras/make-release b/extras/make-release
index 0db539acd..26868a45f 100755
--- a/extras/make-release
+++ b/extras/make-release
@@ -33,12 +33,20 @@ case "$(uname)" in
MAKE=gmake
SHA256="sha256 -r"
;;
+ Darwin)
+ MAKE=make
+ SHA256="shasum -a 256"
+ ;;
*)
MAKE=make
SHA256=sha256sum
;;
esac
+function sha256 {
+ exec $SHA256 $@ | awk '{print $1 " " $2}'
+}
+
cat <<EOF
Release Summary
@@ -102,7 +110,7 @@ function prepare_upload () {
|| bail "Could not copy NEWS file"
(cd release-data && {
- $SHA256 * > ${PACKAGE_NAME}-${PACKAGE_VERSION}.sha256sum \
+ sha256 * > ${PACKAGE_NAME}-${PACKAGE_VERSION}.sha256sum \
|| bail "Could not sha256sum the release files"
}) || exit 1
}