OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 # | |
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 | |
5 # found in the LICENSE file. | |
6 | |
7 """Fetches an archived chromium build into | |
8 src/chrome/tools/test/reference_build unless | |
9 src/chrome/tools/test/reference_build/REQUESTED_REVISION is the same as | |
10 src/chrome/tools/test/reference_build/CURRENT_REVISION. | |
11 Must be run from the root of a Dartium or multivm checkout. | |
12 | |
13 Usage: | |
14 $ ./src/dart/tools/bots/fetch_reference_build_revision.py | |
15 """ | |
16 | |
17 import os | |
18 import subprocess | |
19 import sys | |
20 | |
21 def main(argv): | |
22 dirname = os.path.join('src', 'chrome', 'tools', | |
23 'test', 'reference_build') | |
24 request = os.path.join(dirname, 'REQUESTED_REVISION') | |
25 found = os.path.join(dirname, 'CURRENT_REVISION') | |
26 if not os.path.exists(request): | |
27 return | |
28 with file(request, 'r') as f: | |
29 request_revision = f.read() | |
30 | |
31 if os.path.exists(found): | |
32 with file(found, 'r') as f: | |
33 found_revision = f.read() | |
34 if found_revision == request_revision: | |
35 return | |
36 | |
37 get_script = os.path.join('src', 'dart', 'tools', | |
38 'bots', 'get_chromium_build.py') | |
39 get_script = os.path.abspath(get_script) | |
40 exit_code = subprocess.call(['python', get_script, | |
41 '-r', request_revision, | |
42 '-t', dirname]) | |
43 if exit_code == 0: | |
44 with file(found, 'w') as f: | |
45 f.write(request_revision) | |
46 return exit_code | |
47 | |
48 if __name__ == '__main__': | |
49 sys.exit(main(sys.argv)) | |
OLD | NEW |