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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 Args: | 107 Args: |
108 name: the name of the desired download. | 108 name: the name of the desired download. |
109 directory: target directory (recreated) to install binary | 109 directory: target directory (recreated) to install binary |
110 version_file: name of file with the current version stamp | 110 version_file: name of file with the current version stamp |
111 latest_pattern: the google store url pattern pointing to the latest binary | 111 latest_pattern: the google store url pattern pointing to the latest binary |
112 permanent_prefix: stable google store folder used to download versions | 112 permanent_prefix: stable google store folder used to download versions |
113 revision_num: The desired revision number to retrieve. If revision_num is | 113 revision_num: The desired revision number to retrieve. If revision_num is |
114 None, we return the latest revision. If the revision number is specified | 114 None, we return the latest revision. If the revision number is specified |
115 but unavailable, find the nearest older revision and use that instead. | 115 but unavailable, find the nearest older revision and use that instead. |
116 """ | 116 """ |
117 osdict = {'Darwin':'mac', 'Linux':'lucid64', 'Windows':'win'} | 117 osdict = {'Darwin':'mac-x64', 'Linux':'linux-x64', 'Windows':'win-ia32'} |
118 | 118 |
119 def FindPermanentUrl(out, osname, the_revision_num): | 119 def FindPermanentUrl(out, osname, the_revision_num): |
120 output_lines = out.split() | 120 output_lines = out.split() |
121 latest = output_lines[-1] | 121 latest = output_lines[-1] |
122 if not the_revision_num: | 122 if not the_revision_num: |
123 latest = (permanent_prefix[:permanent_prefix.rindex('/')] % { 'osname' : | 123 latest = (permanent_prefix[:permanent_prefix.rindex('/')] % { 'osname' : |
124 osname, 'bot' : bot } + latest[latest.rindex('/'):]) | 124 osname, 'bot' : bot } + latest[latest.rindex('/'):]) |
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 }) |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 action='store_true', default=False) | 311 action='store_true', default=False) |
312 args, positional = parser.parse_args() | 312 args, positional = parser.parse_args() |
313 | 313 |
314 if args.revision and int(args.revision) < LAST_VALID[positional[0]]: | 314 if args.revision and int(args.revision) < LAST_VALID[positional[0]]: |
315 return TooEarlyError() | 315 return TooEarlyError() |
316 | 316 |
317 # Use the incremental release bot ('dartium-*-inc-be') by default. | 317 # Use the incremental release bot ('dartium-*-inc-be') by default. |
318 # Issue 13399 Quick fix, update with channel support. | 318 # Issue 13399 Quick fix, update with channel support. |
319 bot = 'inc-be' | 319 bot = 'inc-be' |
320 if args.debug: | 320 if args.debug: |
321 bot = 'debug-be' | 321 print >>sys.stderr, ( |
| 322 'Debug versions of Dartium and content_shell not available') |
| 323 return 1 |
322 | 324 |
323 if positional[0] == 'dartium': | 325 if positional[0] == 'dartium': |
324 GetDartiumRevision('Dartium', bot, DARTIUM_DIR, DARTIUM_VERSION, | 326 GetDartiumRevision('Dartium', bot, DARTIUM_DIR, DARTIUM_VERSION, |
325 DARTIUM_LATEST_PATTERN, DARTIUM_PERMANENT_PATTERN, | 327 DARTIUM_LATEST_PATTERN, DARTIUM_PERMANENT_PATTERN, |
326 args.revision) | 328 args.revision) |
327 elif positional[0] == 'sdk': | 329 elif positional[0] == 'sdk': |
328 GetSdkRevision('sdk', SDK_DIR, SDK_VERSION, SDK_LATEST_PATTERN, | 330 GetSdkRevision('sdk', SDK_DIR, SDK_VERSION, SDK_LATEST_PATTERN, |
329 SDK_PERMANENT, args.revision) | 331 SDK_PERMANENT, args.revision) |
330 elif positional[0] == 'drt': | 332 elif positional[0] == 'drt': |
331 GetDartiumRevision('content_shell', bot, DRT_DIR, DRT_VERSION, | 333 GetDartiumRevision('content_shell', bot, DRT_DIR, DRT_VERSION, |
332 DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN, | 334 DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN, |
333 args.revision) | 335 args.revision) |
334 CopyDrtFont(DRT_DIR) | 336 CopyDrtFont(DRT_DIR) |
335 else: | 337 else: |
336 print ('Please specify the target you wish to download from Google Storage ' | 338 print ('Please specify the target you wish to download from Google Storage ' |
337 '("drt", "dartium", "chromedriver", or "sdk")') | 339 '("drt", "dartium", "chromedriver", or "sdk")') |
338 | 340 |
339 if __name__ == '__main__': | 341 if __name__ == '__main__': |
340 sys.exit(main()) | 342 sys.exit(main()) |
OLD | NEW |