httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1374369 - in /httpd/site/trunk/tools: hash-sign.sh roll.sh
Date Fri, 17 Aug 2012 17:22:18 GMT
Author: jim
Date: Fri Aug 17 17:22:18 2012
New Revision: 1374369

URL: http://svn.apache.org/viewvc?rev=1374369&view=rev
Log:
GPG2 aware

Modified:
    httpd/site/trunk/tools/hash-sign.sh
    httpd/site/trunk/tools/roll.sh

Modified: httpd/site/trunk/tools/hash-sign.sh
URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/hash-sign.sh?rev=1374369&r1=1374368&r2=1374369&view=diff
==============================================================================
--- httpd/site/trunk/tools/hash-sign.sh (original)
+++ httpd/site/trunk/tools/hash-sign.sh Fri Aug 17 17:22:18 2012
@@ -63,7 +63,7 @@ elif test -x "${gpg2}"; then
               -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha1
     fi
   done
-# no openssl found - check if we have gpg
+# no gpg2 found - check if we have gpg
 elif test -x "${gpg}"; then
   for file in ${allfiles}; do
     if test -f "${file}"; then

Modified: httpd/site/trunk/tools/roll.sh
URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/roll.sh?rev=1374369&r1=1374368&r2=1374369&view=diff
==============================================================================
--- httpd/site/trunk/tools/roll.sh (original)
+++ httpd/site/trunk/tools/roll.sh Fri Aug 17 17:22:18 2012
@@ -96,6 +96,7 @@ echo "Generating MD5/SHA1 checksum files
 echo ""
 
 # check for executables
+gpg2="`which gpg2 2> /dev/null | head -1`"
 gpg="`which gpg 2> /dev/null | head -1`"
 pgp="`which pgp 2> /dev/null | head -1`"
 openssl="`which openssl 2> /dev/null | head -1`"
@@ -118,7 +119,23 @@ if test -x "${openssl}"; then
           sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha1
     fi
   done
-# no openssl found - check if we have gpg
+# no openssl found - check if we have gpg2
+elif test -x "${gpg2}"; then
+  for file; do
+    if test -f "${file}"; then
+      echo "gpg2: creating md5 checksum file for ${file} ..."
+      ${gpg2} --print-md md5 ${file} |\
+          sed -e '{N;s#\n##;}' |\
+          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+              -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.md5
+      echo "gpg2: creating sha1 checksum file for ${file} ..."
+      ${gpg} --print-md sha1 ${file} |\
+          sed -e '{N;s#\n##;}' |\
+          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+              -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha1
+    fi
+  done
+# no gpg2 found - check if we have gpg
 elif test -x "${gpg}"; then
   for file; do
     if test -f "${file}"; then
@@ -176,18 +193,20 @@ echo ""
 echo "Cleaning up and signing the files ..."
 echo ""
 
-# if found we use pgp for signing the files
-if test -x "${pgp}"; then
-  if test -n "${user}"; then
-    args="-u ${user}"
+# First look for gpg2
+if test -x "${gpg2}"; then
+  if test -z "${user}"; then
+    args="--default-key ${args}"
+  else
+    args="-u ${user} ${args}"
   fi
   for file; do
     if test -f "${file}"; then
-      echo "pgp: creating asc signature file for ${file} ..."
-      ${pgp} -sba ${file} ${args}
+      echo "gpg2: creating asc signature file for ${file} ..."
+      ${gpg2} --armor ${args} --detach-sign ${file}
     fi
   done
-# no pgp found - check for gpg
+# no gpg2 found - check for gpg
 elif test -x "${gpg}"; then
   if test -z "${user}"; then
     args="--default-key ${args}"
@@ -200,6 +219,19 @@ elif test -x "${gpg}"; then
       ${gpg} --armor ${args} --detach-sign ${file}
     fi
   done
+
+# ... no GnuPG? Try PGP
+elif test -x "${pgp}"; then
+  if test -n "${user}"; then
+    args="-u ${user}"
+  fi
+  for file; do
+    if test -f "${file}"; then
+      echo "pgp: creating asc signature file for ${file} ..."
+      ${pgp} -sba ${file} ${args}
+    fi
+  done
+# no pgp found - check for gpg
 else
   echo "PGP or GnuPG not found!  Not signing release!"
 fi



Mime
View raw message