You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2018/04/10 14:11:50 UTC

[11/50] lucene-solr:jira/solr-12181: LUCENE-7935: Keep md5/sha1 checksums for maven artifacts

LUCENE-7935: Keep md5/sha1 checksums for maven artifacts


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/60ae7be4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/60ae7be4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/60ae7be4

Branch: refs/heads/jira/solr-12181
Commit: 60ae7be40786d6f8a5c5c8393875bf986d2b8877
Parents: 2ace16c
Author: Jan Høydahl <ja...@apache.org>
Authored: Thu Apr 5 02:18:04 2018 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Thu Apr 5 02:18:04 2018 +0200

----------------------------------------------------------------------
 dev-tools/scripts/smokeTestRelease.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/60ae7be4/dev-tools/scripts/smokeTestRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index 9316ff4..f68a9b1 100644
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -1071,36 +1071,36 @@ def checkIdenticalMavenArtifacts(distFiles, artifacts, version):
                               % (artifact, distFilenames[artifactFilename], project))
 
 def verifyMavenDigests(artifacts):
-  print("    verify Maven artifacts' sha1/sha512 digests...")
+  print("    verify Maven artifacts' md5/sha1 digests...")
   reJarWarPom = re.compile(r'\.(?:[wj]ar|pom)$')
   for project in ('lucene', 'solr'):
     for artifactFile in [a for a in artifacts[project] if reJarWarPom.search(a)]:
+      if artifactFile + '.md5' not in artifacts[project]:
+        raise RuntimeError('missing: MD5 digest for %s' % artifactFile)
       if artifactFile + '.sha1' not in artifacts[project]:
         raise RuntimeError('missing: SHA1 digest for %s' % artifactFile)
-      if artifactFile + '.sha512' not in artifacts[project]:
-        raise RuntimeError('missing: SHA512 digest for %s' % artifactFile)
+      with open(artifactFile + '.md5', encoding='UTF-8') as md5File:
+        md5Expected = md5File.read().strip()
       with open(artifactFile + '.sha1', encoding='UTF-8') as sha1File:
         sha1Expected = sha1File.read().strip()
-      with open(artifactFile + '.sha512', encoding='UTF-8') as sha512File:
-        sha512Expected = sha512File.read().strip()
+      md5 = hashlib.md5()
       sha1 = hashlib.sha1()
-      sha512 = hashlib.sha512()
       inputFile = open(artifactFile, 'rb')
       while True:
         bytes = inputFile.read(65536)
         if len(bytes) == 0:
           break
+        md5.update(bytes)
         sha1.update(bytes)
-        sha512.update(bytes)
       inputFile.close()
+      md5Actual = md5.hexdigest()
       sha1Actual = sha1.hexdigest()
-      sha512Actual = sha512.hexdigest()
+      if md5Actual != md5Expected:
+        raise RuntimeError('MD5 digest mismatch for %s: expected %s but got %s'
+                           % (artifactFile, md5Expected, md5Actual))
       if sha1Actual != sha1Expected:
         raise RuntimeError('SHA1 digest mismatch for %s: expected %s but got %s'
                            % (artifactFile, sha1Expected, sha1Actual))
-      if sha512Actual != sha512Expected:
-        raise RuntimeError('SHA512 digest mismatch for %s: expected %s but got %s'
-                           % (artifactFile, sha512Expected, sha512Actual))
 
 def getPOMcoordinate(treeRoot):
   namespace = '{http://maven.apache.org/POM/4.0.0}'