summaryrefslogtreecommitdiffstats
path: root/build-aux/getswdb.sh
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2016-01-25 09:03:50 +0100
committerWerner Koch <wk@gnupg.org>2016-01-25 10:09:02 +0100
commit039a55716b8abd22ce23a96dce34cf2dc4be1862 (patch)
tree917cc07ccc9bf87b0b67089c85dc89c9d385ce75 /build-aux/getswdb.sh
parentdirmngr: Indicate that serial numbers are hexadecimal. (diff)
downloadgnupg2-039a55716b8abd22ce23a96dce34cf2dc4be1862.tar.xz
gnupg2-039a55716b8abd22ce23a96dce34cf2dc4be1862.zip
speedo: Allow use of SHA-256 checksums
* build-aux/getswdb.sh: Add option --find-sha256sum. * build-aux/speedo.mk (libgpg_error_sha2): New var. Also for all other packages. (SHA2SUM): New. (SETVARS, SETVARS_W64): Prefer sha256sum over sha1sum. (installer-from-source): Create swdb fragment. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'build-aux/getswdb.sh')
-rwxr-xr-xbuild-aux/getswdb.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/build-aux/getswdb.sh b/build-aux/getswdb.sh
index e7f6fca77..4a1730b2f 100755
--- a/build-aux/getswdb.sh
+++ b/build-aux/getswdb.sh
@@ -37,6 +37,7 @@ Options:
--skip-verify Do not check signatures
--skip-selfcheck Do not check GnuPG version
--find-sha1sum Print the name of the sha1sum utility
+ --find-sha256sum Print the name of the sha256sum utility
--help Print this help.
EOF
exit $1
@@ -49,6 +50,7 @@ skip_download=no
skip_verify=no
skip_selfcheck=no
find_sha1sum=no
+find_sha256sum=no
while test $# -gt 0; do
case "$1" in
# Set up `optarg'.
@@ -76,6 +78,9 @@ while test $# -gt 0; do
--find-sha1sum)
find_sha1sum=yes
;;
+ --find-sha256sum)
+ find_sha256sum=yes
+ ;;
*)
usage 1 1>&2
;;
@@ -96,6 +101,21 @@ if [ ${find_sha1sum} = yes ]; then
exit 1
fi
+# Mac OSX has only a shasum and not sha256sum
+if [ ${find_sha256sum} = yes ]; then
+ for i in 'shasum -a 256' sha256sum ; do
+ tmp=$($i </dev/null 2>/dev/null | cut -d ' ' -f1)
+ tmp2="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+ if [ x"$tmp" = x"$tmp2" ]; then
+ echo "$i"
+ exit 0
+ fi
+ done
+ echo "false"
+ exit 1
+fi
+
+
# Get GnuPG version from VERSION file. For a GIT checkout this means
# that ./autogen.sh must have been run first. For a regular tarball
# VERSION is always available.