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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 def HaveSrcInternalAccess(): | 120 def HaveSrcInternalAccess(): |
121 """Checks whether access to src-internal is available.""" | 121 """Checks whether access to src-internal is available.""" |
122 with open(os.devnull, 'w') as nul: | 122 with open(os.devnull, 'w') as nul: |
123 if subprocess.call( | 123 if subprocess.call( |
124 ['svn', 'ls', '--non-interactive', | 124 ['svn', 'ls', '--non-interactive', |
125 'svn://svn.chromium.org/chrome-internal/trunk/src-internal/'], | 125 'svn://svn.chromium.org/chrome-internal/trunk/src-internal/'], |
126 shell=True, stdin=nul, stdout=nul, stderr=nul) == 0: | 126 shell=True, stdin=nul, stdout=nul, stderr=nul) == 0: |
127 return True | 127 return True |
128 return subprocess.call( | 128 return subprocess.call( |
129 ['git', 'remote', 'show', | 129 ['git', '-c', 'core.askpass=true', 'remote', 'show', |
130 'https://chrome-internal.googlesource.com/chrome/src-internal/'], | 130 'https://chrome-internal.googlesource.com/chrome/src-internal/'], |
131 shell=True, stdin=nul, stdout=nul, stderr=nul) == 0 | 131 shell=True, stdin=nul, stdout=nul, stderr=nul) == 0 |
132 | 132 |
133 | 133 |
134 def DelayBeforeRemoving(target_dir): | 134 def DelayBeforeRemoving(target_dir): |
135 """A grace period before deleting the out of date toolchain directory.""" | 135 """A grace period before deleting the out of date toolchain directory.""" |
136 if (os.path.isdir(target_dir) and | 136 if (os.path.isdir(target_dir) and |
137 not bool(int(os.environ.get('CHROME_HEADLESS', '0')))): | 137 not bool(int(os.environ.get('CHROME_HEADLESS', '0')))): |
138 for i in range(9, 0, -1): | 138 for i in range(9, 0, -1): |
139 sys.stdout.write( | 139 sys.stdout.write( |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 if options.output_json: | 197 if options.output_json: |
198 shutil.copyfile(os.path.join(target_dir, '..', 'data.json'), | 198 shutil.copyfile(os.path.join(target_dir, '..', 'data.json'), |
199 options.output_json) | 199 options.output_json) |
200 | 200 |
201 return 0 | 201 return 0 |
202 | 202 |
203 | 203 |
204 if __name__ == '__main__': | 204 if __name__ == '__main__': |
205 sys.exit(main()) | 205 sys.exit(main()) |
OLD | NEW |