Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5006)

Unified Diff: chrome/tools/build/win/scan_server_dlls.py

Issue 202044: Add exe servers to the list of binaries that may be packaged with the mini_in... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/mini_installer/chrome.release ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/build/win/scan_server_dlls.py
===================================================================
--- chrome/tools/build/win/scan_server_dlls.py (revision 25720)
+++ chrome/tools/build/win/scan_server_dlls.py (working copy)
@@ -64,23 +64,33 @@
dll_array_string += ', '
dll_array_string += "L\"%s\"" % dll
- f = open(output_file, 'w')
+ if len(registered_dll_list) == 0:
+ contents = GENERATED_DLL_INCLUDE_FILE_CONTENTS % ("L\"\"", 0)
+ else:
+ contents = GENERATED_DLL_INCLUDE_FILE_CONTENTS % (dll_array_string,
+ len(registered_dll_list))
+
+ # Don't rewrite the header file if we don't need to.
try:
- if len(registered_dll_list) == 0:
- f.write(GENERATED_DLL_INCLUDE_FILE_CONTENTS % ("L\"\"", 0))
- else:
- f.write(GENERATED_DLL_INCLUDE_FILE_CONTENTS % (dll_array_string,
- len(registered_dll_list)))
- finally:
- f.close()
+ old_file = open(output_file, 'r')
+ except EnvironmentError:
+ old_contents = None
+ else:
+ old_contents = old_file.read()
kuchhal 2009/09/10 17:08:23 old_file.close() here somewhere
robertshield 2009/09/10 17:30:46 Added, thanks!
+ if contents != old_contents:
+ print 'Updating server dll header: ' + str(output_file)
+ open(output_file, 'w').write(contents)
+
def ScanServerDlls(config, distribution, output_dir):
"""Scans for DLLs in the specified section of config that are in the
subdirectory of output_dir named SERVERS_DIR. Returns a list of only the
filename components of the paths to all matching DLLs.
"""
+ print "Scanning for server DLLs in " + output_dir
+
registered_dll_list = []
ScanDllsInSection(config, 'GENERAL', output_dir, registered_dll_list)
if distribution:
@@ -107,8 +117,9 @@
for file in glob.glob(os.path.join(output_dir, option)):
if option.startswith(SERVERS_DIR):
(x, file_name) = os.path.split(file)
- print "Found server DLL file: " + file_name
- registered_dll_list.append(file_name)
+ if file_name.lower().endswith('.dll'):
+ print "Found server DLL file: " + file_name
+ registered_dll_list.append(file_name)
def RunSystemCommand(cmd):
« no previous file with comments | « chrome/installer/mini_installer/chrome.release ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698