diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 00:46:37 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-03 00:46:37 +0000 |
commit | 3ffc971c4ff0012e10f8896014db456c6f373d0a (patch) | |
tree | 9d1c72735b83caa900d9175bb8c9de5f8136c57e /chrome/tools | |
parent | 3159b063944bba8776395cce83815d1e847f0008 (diff) | |
download | chromium_src-3ffc971c4ff0012e10f8896014db456c6f373d0a.zip chromium_src-3ffc971c4ff0012e10f8896014db456c6f373d0a.tar.gz chromium_src-3ffc971c4ff0012e10f8896014db456c6f373d0a.tar.bz2 |
Avoid unnecessary rebuilds of installer_util and chrome.dll by only
writing out appid.h (and updating its timestamp) if the contents change.
BUG=16470
TEST=Use F5 to debug unit_tests
Review URL: http://codereview.chromium.org/199001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25290 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools')
-rw-r--r-- | chrome/tools/build/appid.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/tools/build/appid.py b/chrome/tools/build/appid.py index b563022..f471a4e 100644 --- a/chrome/tools/build/appid.py +++ b/chrome/tools/build/appid.py @@ -22,11 +22,15 @@ const wchar_t kChromeGuid[] = L"%s"; def GenerateAppIdHeader(opts): contents = GENERATED_APPID_INCLUDE_FILE_CONTENTS % opts.appid - output_file = open(opts.output_file, 'w') try: - output_file.write(contents) - finally: - output_file.close() + ofp = open(opts.output_file, 'r') + except EnvironmentError: + current_contents = None + else: + current_contents = ofp.read() + + if contents != current_contents: + open(opts.output_file, 'w').write(contents) def main(): parser = optparse.OptionParser() |