[banshee] Ensure sha256 sum output is consistent



commit 2eb8cc318734f59cf2a076c0de1cd839d8e9b177
Author: Aaron Bockover <aaron abock org>
Date:   Thu Mar 24 14:52:08 2011 -0400

    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.

 extras/make-release |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/extras/make-release b/extras/make-release
index 0db539a..26868a4 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
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]