| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 """A tool to extract size information for chrome, executed by buildbot. | 6 """A tool to extract size information for chrome, executed by buildbot. |
| 7 | 7 |
| 8 When this is run, the current directory (cwd) should be the outer build | 8 When this is run, the current directory (cwd) should be the outer build |
| 9 directory (e.g., chrome-release/build/). | 9 directory (e.g., chrome-release/build/). |
| 10 | 10 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 # If no base_names matched, fail script. | 102 # If no base_names matched, fail script. |
| 103 return 66 | 103 return 66 |
| 104 | 104 |
| 105 | 105 |
| 106 def main_linux(options, args): | 106 def main_linux(options, args): |
| 107 """Print appropriate size information about built Linux targets. | 107 """Print appropriate size information about built Linux targets. |
| 108 | 108 |
| 109 Returns the first non-zero exit status of any command it executes, | 109 Returns the first non-zero exit status of any command it executes, |
| 110 or zero on success. | 110 or zero on success. |
| 111 """ | 111 """ |
| 112 target_dir = os.path.join(os.path.dirname(options.build_dir), 'out', | 112 target_dir = os.path.join(os.path.dirname(options.build_dir), |
| 113 options.target) | 113 'sconsbuild', options.target) |
| 114 chrome = os.path.join(target_dir, 'chrome') | 114 chrome = os.path.join(target_dir, 'chrome') |
| 115 | 115 |
| 116 result = 0 | 116 result = 0 |
| 117 | 117 |
| 118 print "*RESULT chrome: chrome= %s bytes" % get_size(chrome) | 118 print "*RESULT chrome: chrome= %s bytes" % get_size(chrome) |
| 119 | 119 |
| 120 p = subprocess.Popen(['size', chrome], stdout=subprocess.PIPE) | 120 p = subprocess.Popen(['size', chrome], stdout=subprocess.PIPE) |
| 121 stdout = p.communicate()[0] | 121 stdout = p.communicate()[0] |
| 122 text, data, bss = re.search('(\d+)\s+(\d+)\s+(\d+)', stdout).groups() | 122 text, data, bss = re.search('(\d+)\s+(\d+)\s+(\d+)', stdout).groups() |
| 123 if result == 0: | 123 if result == 0: |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 else: | 237 else: |
| 238 sys.stderr.write('Unknown platform %s.\n' % repr(options.platform)) | 238 sys.stderr.write('Unknown platform %s.\n' % repr(options.platform)) |
| 239 msg = 'Use the --platform= option to specify a supported platform:\n' | 239 msg = 'Use the --platform= option to specify a supported platform:\n' |
| 240 sys.stderr.write(msg + ' ' + ' '.join(platforms) + '\n') | 240 sys.stderr.write(msg + ' ' + ' '.join(platforms) + '\n') |
| 241 return 2 | 241 return 2 |
| 242 return real_main(options, args) | 242 return real_main(options, args) |
| 243 | 243 |
| 244 | 244 |
| 245 if '__main__' == __name__: | 245 if '__main__' == __name__: |
| 246 sys.exit(main()) | 246 sys.exit(main()) |
| OLD | NEW |