Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Fetches an archived chromium build into | 7 """Fetches an archived chromium build into |
| 8 src/chrome/tools/test/reference_build unless | 8 src/chrome/tools/test/reference_build unless |
| 9 src/chrome/tools/test/reference_build/REQUESTED_REVISION is the same as | 9 src/chrome/tools/test/reference_build/REQUESTED_REVISION is the same as |
| 10 src/chrome/tools/test/reference_build/CURRENT_REVISION. | 10 src/chrome/tools/test/reference_build/CURRENT_REVISION. |
| 11 Must be run from the root of a Dartium or multivm checkout. | 11 Must be run from the root of a Dartium or multivm checkout. |
| 12 | 12 |
| 13 Usage: | 13 Usage: |
| 14 $ ./src/dart/tools/bots/fetch_reference_build_revision.py | 14 $ ./src/dart/tools/dartium/fetch_reference_build_revision.py |
|
Bill Hesse
2014/05/01 15:12:01
Is this CL leaving the existing copies in tools/bo
vsm
2014/05/02 16:25:50
Yes, I'm not touching the files under bots. We ca
| |
| 15 """ | 15 """ |
| 16 | 16 |
| 17 import os | 17 import os |
| 18 import subprocess | 18 import subprocess |
| 19 import sys | 19 import sys |
| 20 | 20 |
| 21 def main(argv): | 21 def main(argv): |
| 22 dirname = os.path.join('src', 'chrome', 'tools', | 22 dirname = os.path.join('src', 'chrome', 'tools', |
| 23 'test', 'reference_build') | 23 'test', 'reference_build') |
| 24 request = os.path.join(dirname, 'REQUESTED_REVISION') | 24 request = os.path.join(dirname, 'REQUESTED_REVISION') |
| 25 found = os.path.join(dirname, 'CURRENT_REVISION') | 25 found = os.path.join(dirname, 'CURRENT_REVISION') |
| 26 if not os.path.exists(request): | 26 if not os.path.exists(request): |
| 27 return | 27 return |
| 28 with file(request, 'r') as f: | 28 with file(request, 'r') as f: |
| 29 request_revision = f.read() | 29 request_revision = f.read() |
| 30 | 30 |
| 31 if os.path.exists(found): | 31 if os.path.exists(found): |
| 32 with file(found, 'r') as f: | 32 with file(found, 'r') as f: |
| 33 found_revision = f.read() | 33 found_revision = f.read() |
| 34 if found_revision == request_revision: | 34 if found_revision == request_revision: |
| 35 return | 35 return |
| 36 | 36 |
| 37 get_script = os.path.join('src', 'dart', 'tools', | 37 get_script = os.path.join('src', 'dart', 'tools', |
| 38 'bots', 'get_chromium_build.py') | 38 'dartium', 'get_chromium_build.py') |
| 39 get_script = os.path.abspath(get_script) | 39 get_script = os.path.abspath(get_script) |
| 40 exit_code = subprocess.call(['python', get_script, | 40 exit_code = subprocess.call(['python', get_script, |
| 41 '-r', request_revision, | 41 '-r', request_revision, |
| 42 '-t', dirname]) | 42 '-t', dirname]) |
| 43 if exit_code == 0: | 43 if exit_code == 0: |
| 44 with file(found, 'w') as f: | 44 with file(found, 'w') as f: |
| 45 f.write(request_revision) | 45 f.write(request_revision) |
| 46 return exit_code | 46 return exit_code |
| 47 | 47 |
| 48 if __name__ == '__main__': | 48 if __name__ == '__main__': |
| 49 sys.exit(main(sys.argv)) | 49 sys.exit(main(sys.argv)) |
| OLD | NEW |