From 1867bb56c124ea7e6d8cdc023244b31a2c41bf1f Mon Sep 17 00:00:00 2001 From: Rafael Cintron Date: Wed, 2 Jul 2025 14:13:51 -0700 Subject: [PATCH] Add dump_file_list flag to package_from_installed.py To aid in debugging packaging file list, add a dump_file_list flag which writes the list to a file of the user's choosing. Format of the file is "disk_name -> archive_name" Change-Id: Ib0549372fa72069a58d46ef32807e7e7cc713092 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6701090 Reviewed-by: Devon Loehr Reviewed-by: Brian Ryner Commit-Queue: Rafael Cintron Auto-Submit: Rafael Cintron --- win_toolchain/package_from_installed.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/win_toolchain/package_from_installed.py b/win_toolchain/package_from_installed.py index e38d5a34ea..fb698cd621 100644 --- a/win_toolchain/package_from_installed.py +++ b/win_toolchain/package_from_installed.py @@ -538,6 +538,12 @@ def main(): default=False, dest='allow_multiple_vs_installs', help='Specify if multiple VS installs are allowed.') + parser.add_option('--dump_file_list', + action='store', + type='string', + dest='dump_file_list', + default='', + help='Specify a file to dump the ZIP file\'s file list.') (options, args) = parser.parse_args() if options.repackage_dir: @@ -578,9 +584,14 @@ def main(): AddEnvSetup(files, options.arm) - if False: - for f in files: - print(f[0], '->', f[1]) + # Dump file list if requested + if options.dump_file_list: + print('Dumping file list to %s...' % options.dump_file_list) + with open(options.dump_file_list, 'wt', newline='', + encoding='utf-8') as f: + for disk_name, archive_name in files: + f.write('%s -> %s\n' % (disk_name, archive_name)) + print('File list dumped successfully.') return 0 output = 'out.zip'