Chromium Code Reviews| 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 """Snapshot Build Bisect Tool | 6 """Snapshot Build Bisect Tool |
| 7 | 7 |
| 8 This script bisects a snapshot archive using binary search. It starts at | 8 This script bisects a snapshot archive using binary search. It starts at |
| 9 a bad revision (it will try to guess HEAD) and asks for a last known-good | 9 a bad revision (it will try to guess HEAD) and asks for a last known-good |
| 10 revision. It will then binary search across this revision range by downloading, | 10 revision. It will then binary search across this revision range by downloading, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 self._archive_extract_dir = 'chrome-precise32' | 151 self._archive_extract_dir = 'chrome-precise32' |
| 152 elif self.platform == 'linux64': | 152 elif self.platform == 'linux64': |
| 153 self._listing_platform_dir = 'precise64/' | 153 self._listing_platform_dir = 'precise64/' |
| 154 self.archive_name = 'chrome-precise64.zip' | 154 self.archive_name = 'chrome-precise64.zip' |
| 155 self._archive_extract_dir = 'chrome-precise64' | 155 self._archive_extract_dir = 'chrome-precise64' |
| 156 elif self.platform == 'mac': | 156 elif self.platform == 'mac': |
| 157 self._listing_platform_dir = 'mac/' | 157 self._listing_platform_dir = 'mac/' |
| 158 self._binary_name = 'Google Chrome.app/Contents/MacOS/Google Chrome' | 158 self._binary_name = 'Google Chrome.app/Contents/MacOS/Google Chrome' |
| 159 elif self.platform == 'win': | 159 elif self.platform == 'win': |
| 160 self._listing_platform_dir = 'win/' | 160 self._listing_platform_dir = 'win/' |
| 161 self.archive_name = 'chrome-win.zip' | |
| 162 self._archive_extract_dir = 'chrome-win' | |
| 161 else: | 163 else: |
| 162 if self.platform in ('linux', 'linux64', 'linux-arm'): | 164 if self.platform in ('linux', 'linux64', 'linux-arm'): |
| 163 self.archive_name = 'chrome-linux.zip' | 165 self.archive_name = 'chrome-linux.zip' |
| 164 self._archive_extract_dir = 'chrome-linux' | 166 self._archive_extract_dir = 'chrome-linux' |
| 165 if self.platform == 'linux': | 167 if self.platform == 'linux': |
| 166 self._listing_platform_dir = 'Linux/' | 168 self._listing_platform_dir = 'Linux/' |
| 167 elif self.platform == 'linux64': | 169 elif self.platform == 'linux64': |
| 168 self._listing_platform_dir = 'Linux_x64/' | 170 self._listing_platform_dir = 'Linux_x64/' |
| 169 elif self.platform == 'linux-arm': | 171 elif self.platform == 'linux-arm': |
| 170 self._listing_platform_dir = 'Linux_ARM_Cross-Compile/' | 172 self._listing_platform_dir = 'Linux_ARM_Cross-Compile/' |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 stdout = RunGsutilCommand(['ls', query]) | 440 stdout = RunGsutilCommand(['ls', query]) |
| 439 return [url[len(query):].strip('/') for url in stdout.splitlines()] | 441 return [url[len(query):].strip('/') for url in stdout.splitlines()] |
| 440 | 442 |
| 441 # Download the revlist and filter for just the range between good and bad. | 443 # Download the revlist and filter for just the range between good and bad. |
| 442 minrev = min(self.good_revision, self.bad_revision) | 444 minrev = min(self.good_revision, self.bad_revision) |
| 443 maxrev = max(self.good_revision, self.bad_revision) | 445 maxrev = max(self.good_revision, self.bad_revision) |
| 444 build_numbers = GsutilList(GS_BUCKET_NAME) | 446 build_numbers = GsutilList(GS_BUCKET_NAME) |
| 445 revision_re = re.compile(r'(\d\d\.\d\.\d{4}\.\d+)') | 447 revision_re = re.compile(r'(\d\d\.\d\.\d{4}\.\d+)') |
| 446 build_numbers = filter(lambda b: revision_re.search(b), build_numbers) | 448 build_numbers = filter(lambda b: revision_re.search(b), build_numbers) |
| 447 final_list = [] | 449 final_list = [] |
| 448 i = 0 | 450 i = 0 |
|
DaleCurtis
2014/08/21 18:24:00
While you're here, I noticed this post commit: i i
pshenoy
2014/08/21 18:34:49
Done.
| |
| 449 parsed_build_numbers = [LooseVersion(x) for x in build_numbers] | 451 parsed_build_numbers = [LooseVersion(x) for x in build_numbers] |
| 450 connection = httplib.HTTPConnection(GOOGLE_APIS_URL) | 452 connection = httplib.HTTPConnection(GOOGLE_APIS_URL) |
| 451 for build_number in sorted(parsed_build_numbers): | 453 for build_number in sorted(parsed_build_numbers): |
| 452 if build_number > maxrev: | 454 if build_number > maxrev: |
| 453 break | 455 break |
| 454 if build_number < minrev: | 456 if build_number < minrev: |
| 455 continue | 457 continue |
| 456 path = ('/' + GS_BUCKET_NAME + '/' + str(build_number) + '/' + | 458 path = ('/' + GS_BUCKET_NAME + '/' + str(build_number) + '/' + |
| 457 self._listing_platform_dir + self.archive_name) | 459 self._listing_platform_dir + self.archive_name) |
| 458 i = i + 1 | 460 i = i + 1 |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1134 | 1136 |
| 1135 print 'CHANGELOG URL:' | 1137 print 'CHANGELOG URL:' |
| 1136 if opts.official_builds: | 1138 if opts.official_builds: |
| 1137 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) | 1139 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
| 1138 else: | 1140 else: |
| 1139 print ' ' + CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) | 1141 print ' ' + CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
| 1140 | 1142 |
| 1141 | 1143 |
| 1142 if __name__ == '__main__': | 1144 if __name__ == '__main__': |
| 1143 sys.exit(main()) | 1145 sys.exit(main()) |
| OLD | NEW |