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 """Downloads and unpacks a toolchain for building on Windows. The contents are | 6 """Downloads and unpacks a toolchain for building on Windows. The contents are |
7 matched by sha1 which will be updated when the toolchain is updated. | 7 matched by sha1 which will be updated when the toolchain is updated. |
8 | 8 |
9 Having a toolchain script in depot_tools means that it's not versioned | 9 Having a toolchain script in depot_tools means that it's not versioned |
10 directly with the source code. That is, if the toolchain is upgraded, but | 10 directly with the source code. That is, if the toolchain is upgraded, but |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 # ignored_directories list isn't relevant on non-Windows hosts. | 81 # ignored_directories list isn't relevant on non-Windows hosts. |
82 | 82 |
83 ignored_directories = ['wer\\reportqueue', | 83 ignored_directories = ['wer\\reportqueue', |
84 'win_sdk\\debuggers\\x86\\sym\\', | 84 'win_sdk\\debuggers\\x86\\sym\\', |
85 'win_sdk\\debuggers\\x64\\sym\\'] | 85 'win_sdk\\debuggers\\x64\\sym\\'] |
86 for base, _, files in os.walk(root): | 86 for base, _, files in os.walk(root): |
87 paths = [os.path.join(base, f) for f in files] | 87 paths = [os.path.join(base, f) for f in files] |
88 for p in paths: | 88 for p in paths: |
89 if any(ignored_dir in p.lower() for ignored_dir in ignored_directories): | 89 if any(ignored_dir in p.lower() for ignored_dir in ignored_directories): |
90 continue | 90 continue |
91 file_list.append(p) | 91 file_list.append(p.lower()) |
hans
2016/06/08 17:07:55
This would essentially undo https://codereview.chr
| |
92 return sorted(file_list, key=lambda s: s.replace('/', '\\').lower()) | 92 return sorted(file_list, key=lambda s: s.replace('/', '\\').lower()) |
93 | 93 |
94 | 94 |
95 def MakeTimestampsFileName(root, sha1): | 95 def MakeTimestampsFileName(root, sha1): |
96 return os.path.join(root, os.pardir, '%s.timestamps' % sha1) | 96 return os.path.join(root, os.pardir, '%s.timestamps' % sha1) |
97 | 97 |
98 | 98 |
99 def CalculateHash(root, expected_hash): | 99 def CalculateHash(root, expected_hash): |
100 """Calculates the sha1 of the paths to all files in the given |root| and the | 100 """Calculates the sha1 of the paths to all files in the given |root| and the |
101 contents of those files, and returns as a hex string. | 101 contents of those files, and returns as a hex string. |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
536 if os.environ.get('GYP_MSVS_VERSION') == '2015': | 536 if os.environ.get('GYP_MSVS_VERSION') == '2015': |
537 InstallUniversalCRTIfNeeded(abs_toolchain_target_dir) | 537 InstallUniversalCRTIfNeeded(abs_toolchain_target_dir) |
538 | 538 |
539 RemoveUnusedToolchains(target_dir) | 539 RemoveUnusedToolchains(target_dir) |
540 | 540 |
541 return 0 | 541 return 0 |
542 | 542 |
543 | 543 |
544 if __name__ == '__main__': | 544 if __name__ == '__main__': |
545 sys.exit(main()) | 545 sys.exit(main()) |
OLD | NEW |