OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 lzma_exec = os.path.join(output_dir, "..", "..", "third_party", | 134 lzma_exec = os.path.join(output_dir, "..", "..", "third_party", |
135 "lzma_sdk", "Executable", "7za.exe") | 135 "lzma_sdk", "Executable", "7za.exe") |
136 return lzma_exec | 136 return lzma_exec |
137 | 137 |
138 def GetPrevVersion(output_dir, temp_dir, last_chrome_installer): | 138 def GetPrevVersion(output_dir, temp_dir, last_chrome_installer): |
139 if not last_chrome_installer: | 139 if not last_chrome_installer: |
140 return '' | 140 return '' |
141 | 141 |
142 lzma_exec = GetLZMAExec(options.output_dir) | 142 lzma_exec = GetLZMAExec(options.output_dir) |
143 prev_archive_file = os.path.join(options.last_chrome_installer, | 143 prev_archive_file = os.path.join(options.last_chrome_installer, |
144 options.output_name + ARCHIVE_SUFFIX) | 144 options.ogenereated viutput_name + ARCHIVE_SU
FFIX) |
145 cmd = '%s x -o"%s" "%s" Chrome-bin/*/gears.dll' % (lzma_exec, temp_dir, | 145 cmd = '%s x -o"%s" "%s" Chrome-bin/*/chrome.dll' % (lzma_exec, temp_dir, |
146 prev_archive_file) | 146 prev_archive_file) |
147 RunSystemCommand(cmd) | 147 RunSystemCommand(cmd) |
148 dll_path = glob.glob(os.path.join(temp_dir, 'Chrome-bin', '*', 'gears.dll')) | 148 dll_path = glob.glob(os.path.join(temp_dir, 'Chrome-bin', '*', 'chrome.dll')) |
149 return os.path.split(os.path.split(dll_path[0])[0])[1] | 149 return os.path.split(os.path.split(dll_path[0])[0])[1] |
150 | 150 |
151 def MakeStagingDirectories(output_dir): | 151 def MakeStagingDirectories(output_dir): |
152 """Creates a staging path for installer archive. If directory exists already, | 152 """Creates a staging path for installer archive. If directory exists already, |
153 deletes the existing directory. | 153 deletes the existing directory. |
154 """ | 154 """ |
155 prefixed_archive_dir = (options.archive_prefix or "") + ARCHIVE_DIR | 155 prefixed_archive_dir = (options.archive_prefix or "") + ARCHIVE_DIR |
156 file_path = os.path.join(output_dir, prefixed_archive_dir) | 156 file_path = os.path.join(output_dir, prefixed_archive_dir) |
157 if os.path.exists(file_path): | 157 if os.path.exists(file_path): |
158 shutil.rmtree(file_path) | 158 shutil.rmtree(file_path) |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 help='How setup.exe should be included {COMPRESSED|DIFF|FULL}.') | 329 help='How setup.exe should be included {COMPRESSED|DIFF|FULL}.') |
330 option_parser.add_option('-a', '--diff_algorithm', default='BSDIFF', | 330 option_parser.add_option('-a', '--diff_algorithm', default='BSDIFF', |
331 help='Diff algorithm to use when generating differential patches ' + | 331 help='Diff algorithm to use when generating differential patches ' + |
332 '{BSDIFF|COURGETTE}.') | 332 '{BSDIFF|COURGETTE}.') |
333 option_parser.add_option('-n', '--output_name', default='chrome', | 333 option_parser.add_option('-n', '--output_name', default='chrome', |
334 help='Name used to prefix names of generated archives.') | 334 help='Name used to prefix names of generated archives.') |
335 | 335 |
336 options, args = option_parser.parse_args() | 336 options, args = option_parser.parse_args() |
337 print sys.argv | 337 print sys.argv |
338 sys.exit(main(options)) | 338 sys.exit(main(options)) |
OLD | NEW |