OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 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 # This script helps workaround IncrediBuild problem on Windows. | 6 # This script helps workaround IncrediBuild problem on Windows. |
7 # See http://crbug.com/17706. | 7 # See http://crbug.com/17706. |
8 | 8 |
9 import os | 9 import os |
10 import sys | 10 import sys |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 output_headers = [file for file in output_files if file.endswith('.h')] | 46 output_headers = [file for file in output_files if file.endswith('.h')] |
47 for build_type in ('Debug', 'Release'): | 47 for build_type in ('Debug', 'Release'): |
48 build_path = os.path.join(_SRC_PATH, 'chrome', build_type) | 48 build_path = os.path.join(_SRC_PATH, 'chrome', build_type) |
49 | 49 |
50 # We guess target file output based on path of the grd file (the first | 50 # We guess target file output based on path of the grd file (the first |
51 # path component after 'src'). | 51 # path component after 'src'). |
52 intermediate_path = os.path.join(build_path, 'obj', | 52 intermediate_path = os.path.join(build_path, 'obj', |
53 'global_intermediate', path_components[1]) | 53 'global_intermediate', path_components[1]) |
54 | 54 |
55 for header in output_headers: | 55 for header in output_headers: |
56 full_path = os.path.join(intermediate_path, header) | 56 full_path = os.path.normpath(os.path.join(intermediate_path, header)) |
57 try: | 57 if os.path.exists(full_path): |
58 os.remove(full_path) | 58 try: |
59 print 'Clobbered ' + full_path | 59 os.remove(full_path) |
60 except OSError: | 60 except OSError, e: |
61 print 'Could not remove ' + full_path + '. Continuing.' | 61 fmt = 'Could not remove %s: %s. Continuing.\n' |
| 62 sys.stderr.write(fmt % (full_path, e)) |
| 63 else: |
| 64 print 'Clobbered ' + full_path |
OLD | NEW |