httpd-cvs mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1784312&view=rev
Log:
The more complex require gsed, so look for that 1st.

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=1784312&r1=1784311&r2=1784312&view=diff
==============================================================================
--- httpd/site/trunk/tools/hash-sign.sh (original)
+++ httpd/site/trunk/tools/hash-sign.sh Fri Feb 24 18:29:07 2017
@@ -35,6 +35,10 @@ sha256sum="`which sha256sum 2> /dev/null
 md5="`which md5 2> /dev/null | head -1`"
 sha1="`which sha1 2> /dev/null | head -1`"
 sha256="`which sha256 2> /dev/null | head -1`"
+sed="`which gsed 2> /dev/null | head -1`"
+if ! test -x "${sed}"; then
+  sed="`which sed 2> /dev/null | head -1`"
+fi;
 
 # if found we use openssl for generating the checksums
 # and convert the results into machine-readable format.
@@ -43,13 +47,13 @@ if test -x "${openssl}"; then
     if test -f "${file}"; then
       echo "openssl: creating md5 checksum file for ${file} ..."
       ${openssl} md5 ${file} |\
-          sed -e 's#^MD5(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.md5
+          ${sed} -e 's#^MD5(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.md5
       echo "openssl: creating sha1 checksum file for ${file} ..."
       ${openssl} sha1 ${file} |\
-          sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha1
+          ${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
+          ${sed} -e 's#^SHA256(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha256
     fi
   done
 # no openssl found - check if we have gpg2
@@ -58,17 +62,17 @@ elif test -x "${gpg2}"; then
     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' \
+          ${sed} -e '{N;s#\n##;}' |\
+          ${sed} -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
               -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.md5
       echo "gpg: creating sha1 checksum file for ${file} ..."
       ${gpg2} --print-md sha1 ${file} |\
-          sed -e '{N;s#\n##;}' |\
-          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+          ${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' \
+          ${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
@@ -78,17 +82,17 @@ elif test -x "${gpg}"; then
     if test -f "${file}"; then
       echo "gpg: creating md5 checksum file for ${file} ..."
       ${gpg} --print-md md5 ${file} |\
-          sed -e '{N;s#\n##;}' |\
-          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+          ${sed} -e '{N;s#\n##;}' |\
+          ${sed} -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
               -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.md5
       echo "gpg: 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' \
+          ${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' \
+          ${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
@@ -106,7 +110,7 @@ else
     for file in ${allfiles}; do
       if test -f "${file}"; then
         echo "md5: creating md5 checksum file for ${file} ..."
-        ${md5} -r ${file} | sed -e 's# # *#' > ${file}.md5
+        ${md5} -r ${file} | ${sed} -e 's# # *#' > ${file}.md5
       fi
     done
   fi
@@ -123,7 +127,7 @@ else
     for file in ${allfiles}; do
       if test -f "${file}"; then
         echo "sha1: creating sha1 checksum file for ${file} ..."
-        ${sha1} -r ${file} | sed -e 's# # *#' > ${file}.sha1
+        ${sha1} -r ${file} | ${sed} -e 's# # *#' > ${file}.sha1
       fi
     done
   fi
@@ -138,7 +142,7 @@ else
     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
+        ${sha256} -r ${file} | ${sed} -e 's# # *#' > ${file}.sha256
       fi
     done
   fi

Modified: httpd/site/trunk/tools/roll.sh
URL: http://svn.apache.org/viewvc/httpd/site/trunk/tools/roll.sh?rev=1784312&r1=1784311&r2=1784312&view=diff
==============================================================================
--- httpd/site/trunk/tools/roll.sh (original)
+++ httpd/site/trunk/tools/roll.sh Fri Feb 24 18:29:07 2017
@@ -106,6 +106,10 @@ sha256sum="`which sha256sum 2> /dev/null
 md5="`which md5 2> /dev/null | head -1`"
 sha1="`which sha1 2> /dev/null | head -1`"
 sha256="`which sha256 2> /dev/null | head -1`"
+sed="`which gsed 2> /dev/null | head -1`"
+if ! test -x "${sed}"; then
+  sed="`which sed 2> /dev/null | head -1`"
+fi;
 
 set -- ${dirname}.tar.gz ${dirname}.tar.bz2 ${dirname}-deps.tar.gz ${dirname}-deps.tar.bz2
 # if found we use openssl for generating the checksums
@@ -115,13 +119,13 @@ if test -x "${openssl}"; then
     if test -f "${file}"; then
       echo "openssl: creating md5 checksum file for ${file} ..."
       ${openssl} md5 ${file} |\
-          sed -e 's#^MD5(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.md5
+          ${sed} -e 's#^MD5(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.md5
       echo "openssl: creating sha1 checksum file for ${file} ..."
       ${openssl} sha1 ${file} |\
-          sed -e 's#^SHA1(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha1
+          ${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
+          ${sed} -e 's#^SHA256(\(.*\))= \([0-9a-f]*\)$#\2 *\1#' > ${file}.sha256
     fi
   done
 # no openssl found - check if we have gpg2
@@ -130,17 +134,17 @@ elif test -x "${gpg2}"; then
     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' \
+          ${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' \
+          ${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' \
+          ${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
@@ -150,17 +154,17 @@ elif test -x "${gpg}"; then
     if test -f "${file}"; then
       echo "gpg: creating md5 checksum file for ${file} ..."
       ${gpg} --print-md md5 ${file} |\
-          sed -e '{N;s#\n##;}' |\
-          sed -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
+          ${sed} -e '{N;s#\n##;}' |\
+          ${sed} -e 's#\(.*\): \(.*\)#\2::\1#;s#[\r\n]##g;s# ##g' \
               -e 'y#ABCDEF#abcdef#;s#::# *#' > ${file}.md5
       echo "gpg: 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' \
+          ${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' \
+          ${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
@@ -178,7 +182,7 @@ else
     for file; do
       if test -f "${file}"; then
         echo "md5: creating md5 checksum file for ${file} ..."
-        ${md5} -r ${file} | sed -e 's# # *#' > ${file}.md5
+        ${md5} -r ${file} | ${sed} -e 's# # *#' > ${file}.md5
       fi
     done
   fi
@@ -195,7 +199,7 @@ else
     for file; do
       if test -f "${file}"; then
         echo "sha1: creating sha1 checksum file for ${file} ..."
-        ${sha1} -r ${file} | sed -e 's# # *#' > ${file}.sha1
+        ${sha1} -r ${file} | ${sed} -e 's# # *#' > ${file}.sha1
       fi
     done
   fi
@@ -211,7 +215,7 @@ else
     for file; do
       if test -f "${file}"; then
         echo "sha256: creating sha256 checksum file for ${file} ..."
-        ${sha256} -r ${file} | sed -e 's# # *#' > ${file}.sha256
+        ${sha256} -r ${file} | ${sed} -e 's# # *#' > ${file}.sha256
       fi
     done
   fi



Mime
View raw message