| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 # Gets or updates a DumpRenderTree (a nearly headless build of chrome). This is | 7 # Gets or updates a DumpRenderTree (a nearly headless build of chrome). This is |
| 8 # used for running browser tests of client applications. | 8 # used for running browser tests of client applications. |
| 9 | 9 |
| 10 import os | 10 import os |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 def main(): | 96 def main(): |
| 97 system = platform.system() | 97 system = platform.system() |
| 98 if system == 'Darwin': | 98 if system == 'Darwin': |
| 99 osname = 'mac' | 99 osname = 'mac' |
| 100 elif system == 'Linux': | 100 elif system == 'Linux': |
| 101 osname = 'lucid64' | 101 osname = 'lucid64' |
| 102 else: | 102 else: |
| 103 print >>sys.stderr, ('WARNING: platform "%s" does not support' | 103 print >>sys.stderr, ('WARNING: platform "%s" does not support' |
| 104 'DumpRenderTree for tests') % system | 104 'DumpRenderTree for tests') % system |
| 105 return 1 | 105 return 0 |
| 106 | 106 |
| 107 ensure_config() | 107 ensure_config() |
| 108 | 108 |
| 109 # Query for the lastest version | 109 # Query for the lastest version |
| 110 pattern = DRT_DARTIUM_LATEST_PATTERN % { 'osname' : osname } | 110 pattern = DRT_DARTIUM_LATEST_PATTERN % { 'osname' : osname } |
| 111 result, out = gsutil('ls', pattern) | 111 result, out = gsutil('ls', pattern) |
| 112 if result == 0: | 112 if result == 0: |
| 113 latest = out.split()[-1] | 113 latest = out.split()[-1] |
| 114 # use permanent link instead, just in case the latest zip entry gets deleted | 114 # use permanent link instead, just in case the latest zip entry gets deleted |
| 115 # while we are downloading it. | 115 # while we are downloading it. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 # create the version stamp | 157 # create the version stamp |
| 158 v = open(VERSION, 'w') | 158 v = open(VERSION, 'w') |
| 159 v.write(latest) | 159 v.write(latest) |
| 160 v.close() | 160 v.close() |
| 161 | 161 |
| 162 print 'Successfully downloaded to %s' % DRT_DIR | 162 print 'Successfully downloaded to %s' % DRT_DIR |
| 163 return 0 | 163 return 0 |
| 164 | 164 |
| 165 if __name__ == '__main__': | 165 if __name__ == '__main__': |
| 166 sys.exit(main()) | 166 sys.exit(main()) |
| OLD | NEW |