You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by ri...@apache.org on 2020/01/28 11:05:41 UTC

[brooklyn-dist] branch master updated: Updates the 'make-release-artifacts.sh' script compatible with both gpg and gpg2

This is an automated email from the ASF dual-hosted git repository.

richard pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-dist.git


The following commit(s) were added to refs/heads/master by this push:
     new d09deb9  Updates the 'make-release-artifacts.sh' script compatible with both gpg and gpg2
     new cfecf9c  Merge pull request #154 from nakomis/fix/make-release-artifacts
d09deb9 is described below

commit d09deb9426b78bfa3f933420c305075300e7c6a6
Author: Martin Harris <ma...@cloudsoftcorp.com>
AuthorDate: Tue Jan 28 10:52:36 2020 +0000

    Updates the 'make-release-artifacts.sh' script compatible with both gpg and gpg2
---
 release/make-release-artifacts.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/release/make-release-artifacts.sh b/release/make-release-artifacts.sh
index f12151c..00e9a7a 100755
--- a/release/make-release-artifacts.sh
+++ b/release/make-release-artifacts.sh
@@ -153,8 +153,16 @@ else
   export GPG_TTY GPG_AGENT_INFO
 fi
 
+# Determine which GPG command to use
+GPG_COMMAND=$((which gpg >> /dev/null && echo gpg) || (which gpg2 >> /dev/null && echo gpg2))
+
+if [ ! -z "${GPG_COMMAND}" ]; then
+    echo "gpg or gpg2 must be installed, exiting"
+    exit
+fi
+
 # A GPG no-op, but causes the password request to happen. It should then be cached by gpg-agent.
-gpg2 -o /dev/null --sign /dev/null
+$GPG_COMMAND -o /dev/null --sign /dev/null
 
 # Discover submodules
 submodules="$( perl -n -e 'if ($_ =~ /path += +(.*)$/) { print $1."\n" }' < .gitmodules )"
@@ -275,7 +283,7 @@ which sha256sum >/dev/null || alias sha256sum='shasum -a 256' && shopt -s expand
 ( cd ${artifact_dir} &&
     for a in *.tar.gz *.zip *.rpm *.deb; do
         sha256sum -b ${a} > ${a}.sha256
-        gpg2 --armor --output ${a}.asc --detach-sig ${a}
+        $GPG_COMMAND --armor --output ${a}.asc --detach-sig ${a}
     done
 )