diff options
author | Jack Lloyd <[email protected]> | 2019-04-18 10:09:03 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-04-18 10:09:03 -0400 |
commit | 698045905a74b3b080ef6a08656d0d92f2b2472d (patch) | |
tree | aa648bb03f32bd391654adc61ae873bb1abddf6e /src/scripts | |
parent | fc4e8b84152211c966ee5c50b34b4893c69ee0f1 (diff) |
In dist script report the size of the archive in MiB
Diffstat (limited to 'src/scripts')
-rwxr-xr-x | src/scripts/dist.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/scripts/dist.py b/src/scripts/dist.py index 57b4d6213..376e1e927 100755 --- a/src/scripts/dist.py +++ b/src/scripts/dist.py @@ -259,10 +259,13 @@ def write_archive(output_basename, archive_type, rel_epoch, all_files, hash_file archive.addfile(tarinfo, open(f, 'rb')) archive.close() + archive_contents = open(output_archive, 'rb').read() + sha256 = hashlib.new('sha256') - sha256.update(open(output_archive, 'rb').read()) + sha256.update(archive_contents) archive_hash = sha256.hexdigest().upper() + logging.info('%s is %.2f MiB' % (output_archive, len(archive_contents) / (1024.0*1024.0))) logging.info('SHA-256(%s) = %s' % (output_archive, archive_hash)) if hash_file is not None: hash_file.write("%s %s\n" % (archive_hash, output_archive)) |