You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2018/04/05 00:03:02 UTC
lucene-solr:lucene7935-reopen: LUCENE-7935: Keep md5/sha1 checksums
for maven artifacts
Repository: lucene-solr
Updated Branches:
refs/heads/lucene7935-reopen [created] 588978107
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/58897810
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/58897810
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/58897810
Branch: refs/heads/lucene7935-reopen
Commit: 58897810750aa263f74933c1fd50e8bc2b1af26a
Parents: 2ace16c
Author: Jan Høydahl <ja...@apache.org>
Authored: Wed Apr 4 23:33:18 2018 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Thu Apr 5 02:02:21 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/58897810/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}'