summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 20:41:13 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-19 20:41:13 +0000
commit95463f5ac69cedec0402e941c5c04462a2c74237 (patch)
tree5c3e0376e462abcf269a936a5b3dbf99abcce673 /build
parent95ff566e8dc4202560e47d18b83a08ce2ac70baa (diff)
downloadchromium_src-95463f5ac69cedec0402e941c5c04462a2c74237.zip
chromium_src-95463f5ac69cedec0402e941c5c04462a2c74237.tar.gz
chromium_src-95463f5ac69cedec0402e941c5c04462a2c74237.tar.bz2
Cosmetic fixes to clobber_generated_headers.py:
Only try to remove a generated header file if it exists. Only report "Clobbered" if we actually removed something. Print the actual system error if the removal fails. Print the error message on stderr, not stdout. Normalize the header file path name. BUG=none TEST=none Review URL: http://codereview.chromium.org/164173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/win/clobber_generated_headers.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/build/win/clobber_generated_headers.py b/build/win/clobber_generated_headers.py
index c7c2d39..8c5521f 100644
--- a/build/win/clobber_generated_headers.py
+++ b/build/win/clobber_generated_headers.py
@@ -52,9 +52,12 @@ for path in sys.argv[1:]:
'global_intermediate', path_components[1])
for header in output_headers:
- full_path = os.path.join(intermediate_path, header)
- try:
- os.remove(full_path)
- print 'Clobbered ' + full_path
- except OSError:
- print 'Could not remove ' + full_path + '. Continuing.'
+ full_path = os.path.normpath(os.path.join(intermediate_path, header))
+ if os.path.exists(full_path):
+ try:
+ os.remove(full_path)
+ except OSError, e:
+ fmt = 'Could not remove %s: %s. Continuing.\n'
+ sys.stderr.write(fmt % (full_path, e))
+ else:
+ print 'Clobbered ' + full_path