httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1784311 - in /httpd/site/trunk/tools: hash-sign.sh roll.sh
Date Fri, 24 Feb 2017 18:11:35 GMT
Author: jim
Date: Fri Feb 24 18:11:35 2017
New Revision: 1784311

URL: http://svn.apache.org/viewvc?rev=1784311&view=rev
Log:
Add SHA256

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=1784311&r1=1784310&r2=1784311&view=diff
==============================================================================
--- httpd/site/trunk/tools/hash-sign.sh (original)
+++ httpd/site/trunk/tools/hash-sign.sh Fri Feb 24 18:11:35 2017
@@ -21,7 +21,7 @@ split="---------------------------------
 
 echo $split
 echo ""
-echo "Generating MD5/SHA1 checksum files ..."
+echo "Generating MD5/SHA1/SHA256 checksum files ..."
 echo ""
 
 # check for executables
@@ -31,8 +31,10 @@ pgp="`which pgp 2> /dev/null | head -1`"
 openssl="`which openssl 2> /dev/null | head -1`"
 md5sum="`which md5sum 2> /dev/null | head -1`"
 sha1sum="`which sha1sum 2> /dev/null | head -1`"
+sha256sum="`which sha256sum 2> /dev/null | head -1`"
 md5="`which md5 2> /dev/null | head -1`"
 sha1="`which sha1 2> /dev/null | head -1`"
+sha256="`which sha256 2> /dev/null | head -1`"
 
 # if found we use openssl for generating the checksums
 # and convert the results into machine-readable format.
@@ -45,6 +47,9 @@ if test -x "${openssl}"; then
       echo "openssl: creating sha1 checksum file for ${file} ..."
       ${openssl} sha1 ${file} |\
           sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha1
+      echo "openssl: creating sha256 checksum file for ${file} ..."
+      ${openssl} sha256 ${file} |\
+          sed -e 's#^SHA256(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha256
     fi
   done
 # no openssl found - check if we have gpg2
@@ -61,6 +66,10 @@ elif test -x "${gpg2}"; then
           sed -e '{N;s#\n##;}' |\
           sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
               -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha1
+      ${gpg2} --print-md sha256 ${file} |\
+          sed -e '{N;s#\n##;}' |\
+          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+              -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha256
     fi
   done
 # no gpg2 found - check if we have gpg
@@ -77,6 +86,10 @@ elif test -x "${gpg}"; then
           sed -e '{N;s#\n##;}' |\
           sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
               -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha1
+      ${gpg} --print-md sha256 ${file} |\
+          sed -e '{N;s#\n##;}' |\
+          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+              -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha256
     fi
   done
 else
@@ -114,6 +127,22 @@ else
       fi
     done
   fi
+  if test -x "${sha256sum}"; then
+    for file in ${allfiles}; do
+      if test -f "${file}"; then
+        echo "sha256sum: creating sha256 checksum file for ${file} ..."
+        ${sha256sum} -b ${file} > ${file}.sha256
+      fi
+    done
+  elif test -x "${sha256}"; then
+    for file in ${allfiles}; do
+      if test -f "${file}"; then
+        echo "sha256: creating sha256 checksum file for ${file} ..."
+        ${sha256} -r ${file} | sed -e 's# # *#' > ${file}.sha256
+      fi
+    done
+  fi
+
 fi
 
 echo $split

Modified: httpd/site/trunk/tools/roll.sh
URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/roll.sh?rev=1784311&r1=1784310&r2=1784311&view=diff
==============================================================================
--- httpd/site/trunk/tools/roll.sh (original)
+++ httpd/site/trunk/tools/roll.sh Fri Feb 24 18:11:35 2017
@@ -92,7 +92,7 @@ bzip2 -9 ${dirname}.tar
 
 echo $split
 echo ""
-echo "Generating MD5/SHA1 checksum files ..."
+echo "Generating MD5/SHA1/SHA256 checksum files ..."
 echo ""
 
 # check for executables
@@ -102,8 +102,10 @@ pgp="`which pgp 2> /dev/null | head -1`"
 openssl="`which openssl 2> /dev/null | head -1`"
 md5sum="`which md5sum 2> /dev/null | head -1`"
 sha1sum="`which sha1sum 2> /dev/null | head -1`"
+sha256sum="`which sha256sum 2> /dev/null | head -1`"
 md5="`which md5 2> /dev/null | head -1`"
 sha1="`which sha1 2> /dev/null | head -1`"
+sha256="`which sha256 2> /dev/null | head -1`"
 
 set -- ${dirname}.tar.gz ${dirname}.tar.bz2 ${dirname}-deps.tar.gz ${dirname}-deps.tar.bz2
 # if found we use openssl for generating the checksums
@@ -117,6 +119,9 @@ if test -x "${openssl}"; then
       echo "openssl: creating sha1 checksum file for ${file} ..."
       ${openssl} sha1 ${file} |\
           sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha1
+      echo "openssl: creating sha256 checksum file for ${file} ..."
+      ${openssl} sha256 ${file} |\
+          sed -e 's#^SHA256(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha256
     fi
   done
 # no openssl found - check if we have gpg2
@@ -133,6 +138,10 @@ elif test -x "${gpg2}"; then
           sed -e '{N;s#\n##;}' |\
           sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
               -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha1
+      ${gpg} --print-md sha256 ${file} |\
+          sed -e '{N;s#\n##;}' |\
+          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+              -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha256
     fi
   done
 # no gpg2 found - check if we have gpg
@@ -149,6 +158,10 @@ elif test -x "${gpg}"; then
           sed -e '{N;s#\n##;}' |\
           sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
               -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha1
+      ${gpg} --print-md sha256 ${file} |\
+          sed -e '{N;s#\n##;}' |\
+          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+              -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.sha256
     fi
   done
 else
@@ -186,6 +199,22 @@ else
       fi
     done
   fi
+  if test -x "${sha256sum}"; then
+    for file; do
+      if test -f "${file}"; then
+        echo "sha256sum: creating sha256 checksum file for ${file} ..."
+        ${sha256sum} -b ${file} > ${file}.sha256
+      fi
+    done
+  # no openssl or gpg found - check for sha1
+  elif test -x "${sha256}"; then
+    for file; do
+      if test -f "${file}"; then
+        echo "sha256: creating sha256 checksum file for ${file} ..."
+        ${sha256} -r ${file} | sed -e 's# # *#' > ${file}.sha256
+      fi
+    done
+  fi
 fi
 
 echo $split



Mime
View raw message