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 content shell (a nearly headless build of chrome). This is | 7 # Gets or updates a content shell (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 json | 10 import json |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 else: | 125 else: |
126 latest = (permanent_prefix % { 'osname' : osname, 'num1' : the_revision_nu
m, | 126 latest = (permanent_prefix % { 'osname' : osname, 'num1' : the_revision_nu
m, |
127 'num2' : the_revision_num, 'bot' : bot }) | 127 'num2' : the_revision_num, 'bot' : bot }) |
128 foundURL = False | 128 foundURL = False |
129 while not foundURL: | 129 while not foundURL: |
130 # Test to ensure this URL exists because the dartium-archive builds can | 130 # Test to ensure this URL exists because the dartium-archive builds can |
131 # have unusual numbering (a range of CL numbers) sometimes. | 131 # have unusual numbering (a range of CL numbers) sometimes. |
132 result, out = Gsutil('ls', permanent_prefix % {'osname' : osname, | 132 result, out = Gsutil('ls', permanent_prefix % {'osname' : osname, |
133 'num1': the_revision_num, 'num2': '*', 'bot': bot }) | 133 'num1': the_revision_num, 'num2': '*', 'bot': bot }) |
134 if result == 0: | 134 if result == 0: |
135 # First try to find one with the the second number the same as the | 135 # First try to find one with the second number the same as the |
136 # requested number. | 136 # requested number. |
137 latest = out.split()[0] | 137 latest = out.split()[0] |
138 # Now test that the permissions are correct so you can actually | 138 # Now test that the permissions are correct so you can actually |
139 # download it. | 139 # download it. |
140 temp_dir = tempfile.mkdtemp() | 140 temp_dir = tempfile.mkdtemp() |
141 temp_zip = os.path.join(temp_dir, 'foo.zip') | 141 temp_zip = os.path.join(temp_dir, 'foo.zip') |
142 returncode, out = Gsutil('cp', latest, 'file://' + temp_zip) | 142 returncode, out = Gsutil('cp', latest, 'file://' + temp_zip) |
143 if returncode == 0: | 143 if returncode == 0: |
144 foundURL = True | 144 foundURL = True |
145 else: | 145 else: |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 GetDartiumRevision('content_shell', bot, DRT_DIR, DRT_VERSION, | 331 GetDartiumRevision('content_shell', bot, DRT_DIR, DRT_VERSION, |
332 DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN, | 332 DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN, |
333 args.revision) | 333 args.revision) |
334 CopyDrtFont(DRT_DIR) | 334 CopyDrtFont(DRT_DIR) |
335 else: | 335 else: |
336 print ('Please specify the target you wish to download from Google Storage ' | 336 print ('Please specify the target you wish to download from Google Storage ' |
337 '("drt", "dartium", "chromedriver", or "sdk")') | 337 '("drt", "dartium", "chromedriver", or "sdk")') |
338 | 338 |
339 if __name__ == '__main__': | 339 if __name__ == '__main__': |
340 sys.exit(main()) | 340 sys.exit(main()) |
OLD | NEW |