You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2018/03/06 23:10:20 UTC
[3/4] kudu git commit: build: stop generating md5 file
build: stop generating md5 file
New guidance from the ASF is to not generate md5 files when producing source
releases. Instead we just generate the sha checksum.
Change-Id: I6b0359d63b660b285c0853cd9b88654a400f14c2
Reviewed-on: http://gerrit.cloudera.org:8080/9504
Tested-by: Kudu Jenkins
Reviewed-by: Dan Burkert <da...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/940e60f0
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/940e60f0
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/940e60f0
Branch: refs/heads/master
Commit: 940e60f0f844782fa01ba449ce6a38e08f721d06
Parents: 1c1d3ba
Author: Todd Lipcon <to...@apache.org>
Authored: Mon Mar 5 17:19:50 2018 -0800
Committer: Todd Lipcon <to...@apache.org>
Committed: Tue Mar 6 22:59:17 2018 +0000
----------------------------------------------------------------------
build-support/build_source_release.py | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/940e60f0/build-support/build_source_release.py
----------------------------------------------------------------------
diff --git a/build-support/build_source_release.py b/build-support/build_source_release.py
index 6d922d4..3006a68 100755
--- a/build-support/build_source_release.py
+++ b/build-support/build_source_release.py
@@ -78,7 +78,7 @@ def create_tarball():
"--prefix=%s/" % artifact_name,
"--output=%s" % tarball_path,
"HEAD"])
- print(Colors.GREEN + "Generated tarball:\t" + Colors.RESET, tarball_path)
+ print(Colors.GREEN + "Generated tarball:\t" + Colors.RESET + tarball_path)
return tarball_path
@@ -118,21 +118,18 @@ def checksum_file(summer, path):
return summer.hexdigest()
-def gen_checksum_files(tarball_path):
+def gen_sha_file(tarball_path):
"""
- Create md5 and sha files of the tarball.
+ Create a sha checksum file of the tarball.
- The output format is compatible with command line tools like 'sha1sum'
- and 'md5sum' so they may be used to verify the checksums.
+ The output format is compatible with command line tools like 'sha1sum' so it
+ can be used to verify the checksum.
"""
- hashes = [(hashlib.sha1, "sha"),
- (hashlib.md5, "md5")]
- for hash_func, extension in hashes:
- digest = checksum_file(hash_func(), tarball_path)
- path = tarball_path + "." + extension
- with open(path, "w") as f:
- f.write("%s\t%s\n" % (digest, os.path.basename(tarball_path)))
- print(Colors.GREEN + ("Generated %s:\t" % extension) + Colors.RESET, path)
+ digest = checksum_file(hashlib.sha1(), tarball_path)
+ path = tarball_path + ".sha"
+ with open(path, "w") as f:
+ f.write("%s\t%s\n" % (digest, os.path.basename(tarball_path)))
+ print(Colors.GREEN + "Generated sha:\t\t" + Colors.RESET + path)
def run_rat(tarball_path):
@@ -182,7 +179,7 @@ def main():
check_repo_not_dirty()
check_no_local_commits()
tarball_path = create_tarball()
- gen_checksum_files(tarball_path)
+ gen_sha_file(tarball_path)
sign_tarball(tarball_path)
run_rat(tarball_path)