OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Extracts a Windows VS2013 toolchain from various downloadable pieces.""" | 6 """Extracts a Windows VS2013 toolchain from various downloadable pieces.""" |
7 | 7 |
8 | 8 |
9 import ctypes | 9 import ctypes |
10 import json | 10 import json |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 target_dir = os.path.abspath(options.targetdir) | 457 target_dir = os.path.abspath(options.targetdir) |
458 if os.path.exists(target_dir): | 458 if os.path.exists(target_dir): |
459 parser.error('%s already exists. Please [re]move it or use ' | 459 parser.error('%s already exists. Please [re]move it or use ' |
460 '--targetdir to select a different target.\n' % | 460 '--targetdir to select a different target.\n' % |
461 target_dir) | 461 target_dir) |
462 # Set the working directory to 7z subdirectory. 7-zip doesn't find its | 462 # Set the working directory to 7z subdirectory. 7-zip doesn't find its |
463 # codec dll very well, so this is the simplest way to make sure it runs | 463 # codec dll very well, so this is the simplest way to make sure it runs |
464 # correctly, as we don't otherwise care about working directory. | 464 # correctly, as we don't otherwise care about working directory. |
465 os.chdir(os.path.join(BASEDIR, '7z')) | 465 os.chdir(os.path.join(BASEDIR, '7z')) |
466 if options.bot_mode and options.sha1: | 466 if options.bot_mode and options.sha1: |
| 467 options.express = False |
467 DoTreeMirror(target_dir, options.sha1) | 468 DoTreeMirror(target_dir, options.sha1) |
468 else: | 469 else: |
469 images = GetSourceImages(options.local, not options.express) | 470 images = GetSourceImages(options.local, not options.express) |
470 extracted = ExtractComponents(images) | 471 extracted = ExtractComponents(images) |
471 CopyToFinalLocation(extracted, target_dir) | 472 CopyToFinalLocation(extracted, target_dir) |
472 GenerateSetEnvCmd(target_dir, not options.express) | 473 GenerateSetEnvCmd(target_dir, not options.express) |
473 | 474 |
474 data = { | 475 data = { |
475 'path': target_dir, | 476 'path': target_dir, |
476 'version': '2013e' if options.express else '2013', | 477 'version': '2013e' if options.express else '2013', |
477 'win8sdk': os.path.join(target_dir, 'win8sdk'), | 478 'win8sdk': os.path.join(target_dir, 'win8sdk'), |
478 'wdk': os.path.join(target_dir, 'wdk'), | 479 'wdk': os.path.join(target_dir, 'wdk'), |
479 'runtime_dirs': [ | 480 'runtime_dirs': [ |
480 os.path.join(target_dir, 'sys64'), | 481 os.path.join(target_dir, 'sys64'), |
481 os.path.join(target_dir, 'sys32'), | 482 os.path.join(target_dir, 'sys32'), |
482 ], | 483 ], |
483 } | 484 } |
484 with open(os.path.join(target_dir, '..', 'data.json'), 'w') as f: | 485 with open(os.path.join(target_dir, '..', 'data.json'), 'w') as f: |
485 json.dump(data, f) | 486 json.dump(data, f) |
486 finally: | 487 finally: |
487 if options.clean: | 488 if options.clean: |
488 DeleteAllTempDirs() | 489 DeleteAllTempDirs() |
489 | 490 |
490 | 491 |
491 if __name__ == '__main__': | 492 if __name__ == '__main__': |
492 sys.exit(main()) | 493 sys.exit(main()) |
OLD | NEW |