| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Script to create Chrome Installer archive. | 6 """Script to create Chrome Installer archive. |
| 7 | 7 |
| 8 This script is used to create an archive of all the files required for a | 8 This script is used to create an archive of all the files required for a |
| 9 Chrome install in appropriate directory structure. It reads chrome.release | 9 Chrome install in appropriate directory structure. It reads chrome.release |
| 10 file as input, creates chrome.7z archive, compresses setup.exe and | 10 file as input, creates chrome.7z archive, compresses setup.exe and |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 def CopySectionFilesToStagingDir(config, section, staging_dir, build_dir): | 110 def CopySectionFilesToStagingDir(config, section, staging_dir, build_dir): |
| 111 """Copies installer archive files specified in section to staging dir. | 111 """Copies installer archive files specified in section to staging dir. |
| 112 This method copies reads section from config file and copies all the files | 112 This method copies reads section from config file and copies all the files |
| 113 specified to staging dir. | 113 specified to staging dir. |
| 114 """ | 114 """ |
| 115 for option in config.options(section): | 115 for option in config.options(section): |
| 116 if option.endswith('dir'): | 116 if option.endswith('dir'): |
| 117 continue | 117 continue |
| 118 | 118 |
| 119 dst = os.path.join(staging_dir, config.get(section, option)) | 119 dst = os.path.join(staging_dir, config.get(section, option)) |
| 120 if not os.path.exists(dst): | 120 files = glob.glob(os.path.join(build_dir, option)) |
| 121 if len(files) > 0 and not os.path.exists(dst): |
| 121 os.makedirs(dst) | 122 os.makedirs(dst) |
| 122 for file in glob.glob(os.path.join(build_dir, option)): | 123 for file in files: |
| 123 dst_file = os.path.join(dst, os.path.basename(file)) | 124 dst_file = os.path.join(dst, os.path.basename(file)) |
| 124 if not os.path.exists(dst_file): | 125 if not os.path.exists(dst_file): |
| 125 shutil.copy(file, dst) | 126 shutil.copy(file, dst) |
| 126 | 127 |
| 127 def GenerateDiffPatch(options, orig_file, new_file, patch_file): | 128 def GenerateDiffPatch(options, orig_file, new_file, patch_file): |
| 128 if (options.diff_algorithm == "COURGETTE"): | 129 if (options.diff_algorithm == "COURGETTE"): |
| 129 exe_file = os.path.join(options.last_chrome_installer, COURGETTE_EXEC) | 130 exe_file = os.path.join(options.last_chrome_installer, COURGETTE_EXEC) |
| 130 cmd = '%s -gen "%s" "%s" "%s"' % (exe_file, orig_file, new_file, patch_file) | 131 cmd = '%s -gen "%s" "%s" "%s"' % (exe_file, orig_file, new_file, patch_file) |
| 131 else: | 132 else: |
| 132 exe_file = os.path.join(options.build_dir, BSDIFF_EXEC) | 133 exe_file = os.path.join(options.build_dir, BSDIFF_EXEC) |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 if not options.resource_file_path: | 407 if not options.resource_file_path: |
| 407 options.options.resource_file_path = os.path.join(options.build_dir, | 408 options.options.resource_file_path = os.path.join(options.build_dir, |
| 408 MINI_INSTALLER_INPUT_FILE) | 409 MINI_INSTALLER_INPUT_FILE) |
| 409 | 410 |
| 410 return options | 411 return options |
| 411 | 412 |
| 412 | 413 |
| 413 if '__main__' == __name__: | 414 if '__main__' == __name__: |
| 414 print sys.argv | 415 print sys.argv |
| 415 sys.exit(main(_ParseOptions())) | 416 sys.exit(main(_ParseOptions())) |
| OLD | NEW |