subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astie...@apache.org
Subject svn commit: r1802329 - in /subversion/trunk/tools/dist: checksums.py dist.sh download-release.sh release.py
Date Tue, 18 Jul 2017 19:49:58 GMT
Author: astieger
Date: Tue Jul 18 19:49:57 2017
New Revision: 1802329

URL: http://svn.apache.org/viewvc?rev=1802329&view=rev
Log:
Use SHA-2 family digests for release

* dist/dist.sh: generate SHA-512 digest
* dist/release.py: generate SHA-512 digest
* dist/checksums.py: support SHA-512 digests
* dist/download-release.sh: remove unused tool

Removed:
    subversion/trunk/tools/dist/download-release.sh
Modified:
    subversion/trunk/tools/dist/checksums.py
    subversion/trunk/tools/dist/dist.sh
    subversion/trunk/tools/dist/release.py

Modified: subversion/trunk/tools/dist/checksums.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/checksums.py?rev=1802329&r1=1802328&r2=1802329&view=diff
==============================================================================
--- subversion/trunk/tools/dist/checksums.py (original)
+++ subversion/trunk/tools/dist/checksums.py Tue Jul 18 19:49:57 2017
@@ -19,12 +19,14 @@
 # under the License.
 #
 #
-# Check MD5 and SHA1 signatures of files, using md5sums and/or
-# sha1sums as manifests.  Replaces the 'md5sum' and 'sha1sum' commands
+# Check MD5 and SHA-1 and SHA-2 signatures of files, using 
+# md5sums, sha1sums, and/or sha512sums as manifests
+# Replaces the 'md5sum', 'sha1sum', and 'sha512sums' commands
 # on systems that do not have them, such as Mac OS X or Windows.
 #
 # Usage: checksums.py [manifest]
-#   where "os.path.basename(manifest)" is either "md5sums" or "sha1sums"
+#   where "os.path.basename(manifest)" is either "md5sums", "sha1sums",
+#   "sha512sums"
 #
 # Tested with the following Python versions:
 #        2.4   2.5   2.6   2.7   3.2
@@ -37,6 +39,7 @@ import sys
 try:
     from hashlib import md5
     from hashlib import sha1
+    from hashlib import sha512
 except ImportError:
     from md5 import md5
     from sha import sha as sha1
@@ -67,9 +70,11 @@ def main(manipath):
         sink = Digester(md5)
     elif manifest == 'sha1sums':
         sink = Digester(sha1)
+    elif manifest == 'sha512sums':
+        sink = Digester(sha512)
     else:
         raise ValueError('The name of the digest manifest must be '
-                         "'md5sums' or 'sha1sums', not '%s'" % manifest)
+                         "'md5sums', 'sha1sums', or 'sha512sums', not '%s'" % manifest)
 
     # No 'with' statement in Python 2.4 ...
     stream = None

Modified: subversion/trunk/tools/dist/dist.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/dist.sh?rev=1802329&r1=1802328&r2=1802329&view=diff
==============================================================================
--- subversion/trunk/tools/dist/dist.sh (original)
+++ subversion/trunk/tools/dist/dist.sh Tue Jul 18 19:49:57 2017
@@ -369,9 +369,10 @@ sign_file()
   fi
 }
 
-# allow md5sum and sha1sum tool names to be overridden
+# allow md5sum, sha1sum, and sha512sum tool names to be overridden
 [ -n "$MD5SUM" ] || MD5SUM=md5sum
 [ -n "$SHA1SUM" ] || SHA1SUM=sha1sum
+[ -n "$SHA512SUM" ] || SHA512SUM=sha512sum
 
 echo ""
 echo "Done:"
@@ -387,6 +388,12 @@ if [ -z "$ZIP" ]; then
     echo "sha1sums:"
     $SHA1SUM "$DISTNAME.tar.bz2" "$DISTNAME.tar.gz"
   fi
+  type $SHA512SUM > /dev/null 2>&1
+  if [ $? -eq 0 ]; then
+    echo ""
+    echo "sha512sums:"
+    $SHA512SUM "$DISTNAME.tar.bz2" "$DISTNAME.tar.gz"
+  fi
 else
   ls -l "$DISTNAME.zip"
   sign_file $DISTNAME.zip
@@ -399,4 +406,10 @@ else
     echo "sha1sum:"
     $SHA1SUM "$DISTNAME.zip"
   fi
+  type $SHA512SUM > /dev/null 2>&1
+  if [ $? -eq 0 ]; then
+    echo ""
+    echo "sha512sum:"
+    $SHA512SUM "$DISTNAME.zip"
+  fi
 fi

Modified: subversion/trunk/tools/dist/release.py
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/release.py?rev=1802329&r1=1802328&r2=1802329&view=diff
==============================================================================
--- subversion/trunk/tools/dist/release.py (original)
+++ subversion/trunk/tools/dist/release.py Tue Jul 18 19:49:57 2017
@@ -554,6 +554,9 @@ def roll_tarballs(args):
         m = hashlib.sha1()
         m.update(open(filename, 'r').read())
         open(filename + '.sha1', 'w').write(m.hexdigest())
+        m = hashlib.sha512()
+        m.update(open(filename, 'r').read())
+        open(filename + '.sha512', 'w').write(m.hexdigest())
 
     shutil.move('svn_version.h.dist',
                 get_deploydir(args.base_dir) + '/' + 'svn_version.h.dist'



Mime
View raw message