Print packaging file size/count stats always

When doing a dry run of packaging the toolchain we have always printed
stats on the size and number of files. It is odd and annoying that we
don't print those stats when doing the actual packaging, so this changes
that.

Change-Id: Ic60c3f4960dacaea39c048dc0c5f4c50b551f68a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2380231
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/31/2380231/2
Bruce Dawson 5 years ago committed by LUCI CQ
parent 336f984f8c
commit 21de33a93c

@ -508,17 +508,16 @@ def main():
if not options.repackage_dir and disk_name.count(WIN_VERSION) > 0:
version_match_count += 1
if os.path.exists(disk_name):
if options.dryrun:
total_size += os.path.getsize(disk_name)
else:
total_size += os.path.getsize(disk_name)
if not options.dryrun:
zf.write(disk_name, archive_name)
else:
missing_files = True
sys.stdout.write('\r%s does not exist.\n\n' % disk_name)
sys.stdout.flush()
sys.stdout.write('\r%1.3f GB of data in %d files, %d files for %s.%s\n' %
(total_size / 1e9, count, version_match_count, WIN_VERSION, ' '*50))
if options.dryrun:
sys.stdout.write('\r%1.3f GB of data in %d files, %d files for %s.%s\n' %
(total_size / 1e9, count, version_match_count, WIN_VERSION, ' '*50))
return 0
if missing_files:
raise Exception('One or more files were missing - aborting')

Loading…
Cancel
Save