diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 20:49:14 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-18 20:49:14 +0000 |
commit | d17e25d36c309225c9ff629600383c18e80f872c (patch) | |
tree | dd8d35b5985f30996bef8b275a734ba04441691a /chrome/tools | |
parent | 14002a61500d0e27db6a1ee6f57f6da0978e2933 (diff) | |
download | chromium_src-d17e25d36c309225c9ff629600383c18e80f872c.zip chromium_src-d17e25d36c309225c9ff629600383c18e80f872c.tar.gz chromium_src-d17e25d36c309225c9ff629600383c18e80f872c.tar.bz2 |
Clarify comments in create_installer_archive.py.
This is a follow-up to https://codereview.chromium.org/63153013/
NOTRY=True
BUG=318950, 246169
Review URL: https://codereview.chromium.org/60233008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235812 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools')
-rwxr-xr-x | chrome/tools/build/win/create_installer_archive.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py index db3a70c..b606fbd 100755 --- a/chrome/tools/build/win/create_installer_archive.py +++ b/chrome/tools/build/win/create_installer_archive.py @@ -325,8 +325,8 @@ def CreateResourceInputFile( # |insert_before|. def CopyAndAugmentManifest(build_dir, output_dir, manifest_name, inserted_string, insert_before): - with open(os.path.join(build_dir, manifest_name), 'r') as manifest_file: - manifest_lines = manifest_file.readlines() + with open(os.path.join(build_dir, manifest_name), 'r') as f: + manifest_lines = f.readlines() insert_line = -1 insert_pos = -1 @@ -342,9 +342,8 @@ def CopyAndAugmentManifest(build_dir, output_dir, manifest_name, manifest_lines[insert_line] = (old[:insert_pos] + '\n' + inserted_string + '\n' + old[insert_pos:]) - with open(os.path.join(output_dir, manifest_name), - 'w') as modified_manifest_file : - modified_manifest_file.write(''.join(manifest_lines)) + with open(os.path.join(output_dir, manifest_name), 'w') as f : + f.write(''.join(manifest_lines)) def CopyIfChanged(src, target_dir): @@ -448,23 +447,26 @@ def DoComponentBuildTasks(staging_dir, build_dir, target_arch, current_version): # chrome.release. build_dlls = glob.glob(os.path.join(build_dir, '*.dll')) staged_dll_basenames = [os.path.basename(staged_dll) for staged_dll in \ - glob.glob(os.path.join(version_dir, '*.dll'))] + glob.glob(os.path.join(version_dir, '*.dll'))] component_dll_filenames = [] for component_dll in [dll for dll in build_dlls if \ - os.path.basename(dll) not in staged_dll_basenames]: + os.path.basename(dll) not in staged_dll_basenames]: # remoting_*.dll's don't belong in the archive (it doesn't depend on them # in gyp). Trying to copy them causes a build race when creating the # installer archive in component mode. See: crbug.com/180996 if os.path.basename(component_dll).startswith('remoting_'): continue # Copy them to the version_dir (for the version assembly to be able to refer - # to them below and thus for chrome.exe to be able to load them at runtime). + # to them below and make sure chrome.exe can find them at runtime). shutil.copy(component_dll, version_dir) # Also copy them directly to the Installer directory for the installed # setup.exe to be able to run (as it doesn't statically link in component # DLLs). - # TODO(gab): This makes the archive ~278MB instead of ~185MB; consider - # copying the DLLs over from the installer. + # This makes the archive ~1.5X bigger (Release ~185MB => ~278MB; + # Debug ~520MB => ~875MB) this is however simpler than any other installer + # change and doesn't make archive generation itself slower so it only + # matters when copying the archive to other test machines. This approach + # can be revised if this is a problem. shutil.copy(component_dll, installer_dir) component_dll_filenames.append(os.path.basename(component_dll)) @@ -478,14 +480,13 @@ def DoComponentBuildTasks(staging_dir, build_dir, target_arch, current_version): shutil.copy(os.path.join(build_dir, 'setup.exe.manifest'), installer_dir) # Augment {version}.manifest to include all component DLLs as part of the - # assembly it constitutes which will allow dependents of this assembly to + # assembly it constitutes, which will allow dependents of this assembly to # find these DLLs. version_assembly_dll_additions = [] for dll_filename in component_dll_filenames: - version_assembly_dll_additions.append( - " <file name='{dll_filename}'/>".format(dll_filename=dll_filename)) + version_assembly_dll_additions.append(" <file name='%s'/>" % dll_filename) CopyAndAugmentManifest(build_dir, version_dir, - '{version}.manifest'.format(version=current_version), + '%s.manifest' % current_version, '\n'.join(version_assembly_dll_additions), '</assembly>') |