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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 def Readconfig(input_file, current_version): | 173 def Readconfig(input_file, current_version): |
174 """Reads config information from input file after setting default value of | 174 """Reads config information from input file after setting default value of |
175 global variabes. | 175 global variabes. |
176 """ | 176 """ |
177 variables = {} | 177 variables = {} |
178 variables['ChromeDir'] = CHROME_DIR | 178 variables['ChromeDir'] = CHROME_DIR |
179 variables['VersionDir'] = os.path.join(variables['ChromeDir'], | 179 variables['VersionDir'] = os.path.join(variables['ChromeDir'], |
180 current_version) | 180 current_version) |
181 config = ConfigParser.SafeConfigParser(variables) | 181 config = ConfigParser.SafeConfigParser(variables) |
182 config.read(input_file) | 182 config.read(input_file) |
183 # Add version assembly manifest to config here, since we cannot hardcode the | |
184 # file name in chrome.release. | |
185 config.set('GENERAL', '%s.manifest' % current_version, '%(VersionDir)s\\') | |
grt (UTC plus 2)
2013/11/07 03:04:23
this scares me since it involves magic. reading ch
| |
183 return config | 186 return config |
184 | 187 |
185 def RunSystemCommand(cmd, **kw): | 188 def RunSystemCommand(cmd, **kw): |
186 print 'Running', cmd | 189 print 'Running', cmd |
187 exit_code = subprocess.call(cmd, **kw) | 190 exit_code = subprocess.call(cmd, **kw) |
188 if (exit_code != 0): | 191 if (exit_code != 0): |
189 raise Exception("Error while running cmd: %s, exit_code: %s" % | 192 raise Exception("Error while running cmd: %s, exit_code: %s" % |
190 (cmd, exit_code)) | 193 (cmd, exit_code)) |
191 | 194 |
192 def CreateArchiveFile(options, staging_dir, current_version, prev_version): | 195 def CreateArchiveFile(options, staging_dir, current_version, prev_version): |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
639 if not options.resource_file_path: | 642 if not options.resource_file_path: |
640 options.resource_file_path = os.path.join(options.build_dir, | 643 options.resource_file_path = os.path.join(options.build_dir, |
641 MINI_INSTALLER_INPUT_FILE) | 644 MINI_INSTALLER_INPUT_FILE) |
642 | 645 |
643 return options | 646 return options |
644 | 647 |
645 | 648 |
646 if '__main__' == __name__: | 649 if '__main__' == __name__: |
647 print sys.argv | 650 print sys.argv |
648 sys.exit(main(_ParseOptions())) | 651 sys.exit(main(_ParseOptions())) |
OLD | NEW |