summaryrefslogtreecommitdiffstats
path: root/chrome/tools
diff options
context:
space:
mode:
authorgab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 22:00:50 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 22:00:50 +0000
commit104aa9ccd1b0a5b7d46c9940f7beed3222a421b1 (patch)
tree9b33c9f7cd79dbe784dc79bdb03d304fddfed7ea /chrome/tools
parent02fa7ff2f23e158dbd3bcaecaad01a0091676588 (diff)
downloadchromium_src-104aa9ccd1b0a5b7d46c9940f7beed3222a421b1.zip
chromium_src-104aa9ccd1b0a5b7d46c9940f7beed3222a421b1.tar.gz
chromium_src-104aa9ccd1b0a5b7d46c9940f7beed3222a421b1.tar.bz2
Fix xml augmentation of manifests for the installer archive.
This was recently broken when fixing gyp to correctly add "AdditionalManifestFiles" in VS2010 as the manifest written now has no endlines (and the previous code was inserting a line above the line with </assembly>... now that <assembly> is on the same line this broke down... R=robertshield@chromium.org BUG= TEST=Copy necessary files and install chrome on another machine, run it, uninstall it. Review URL: https://chromiumcodereview.appspot.com/10452018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools')
-rwxr-xr-xchrome/tools/build/win/create_installer_archive.py33
1 files changed, 19 insertions, 14 deletions
diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py
index a7ae633..5c487ef 100755
--- a/chrome/tools/build/win/create_installer_archive.py
+++ b/chrome/tools/build/win/create_installer_archive.py
@@ -317,17 +317,23 @@ def CreateResourceInputFile(
# |insert_before|.
def CopyAndAugmentManifest(build_dir, output_dir, manifest_name,
inserted_string, insert_before):
- manifest_file = open(
- os.path.join(build_dir, manifest_name), 'r')
+ manifest_file = open(os.path.join(build_dir, manifest_name), 'r')
manifest_lines = manifest_file.readlines()
manifest_file.close()
- insert_index = next((i for i, s in enumerate(manifest_lines)
- if s.find(insert_before) != -1), -1)
- if insert_index == -1:
- raise ValueError('could not find {0} in the manifest:\n{1}'.format(
+ insert_line = -1
+ insert_pos = -1
+ for i in xrange(len(manifest_lines)):
+ insert_pos = manifest_lines[i].find(insert_before)
+ if insert_pos != -1:
+ insert_line = i
+ break
+ if insert_line == -1:
+ raise ValueError('Could not find {0} in the manifest:\n{1}'.format(
insert_before, ''.join(manifest_lines)))
- manifest_lines.insert(insert_index, inserted_string)
+ old = manifest_lines[insert_line]
+ manifest_lines[insert_line] = (old[:insert_pos] + inserted_string +
+ old[insert_pos:])
modified_manifest_file = open(
os.path.join(output_dir, manifest_name), 'w')
@@ -435,13 +441,12 @@ def DoComponentBuildTasks(staging_dir, build_dir, current_version):
exe_manifest_dependencies_list = []
for name in dll_names:
exe_manifest_dependencies_list.append(
- " <dependency>\n"
- " <dependentAssembly>\n"
- " <assemblyIdentity type='win32' name='chrome.{dll_name}'\n"
- " version='0.0.0.0' processorArchitecture='x86'\n"
- " language='*'/>\n"
- " </dependentAssembly>\n"
- " </dependency>\n".format(dll_name=name))
+ "<dependency>"
+ "<dependentAssembly>"
+ "<assemblyIdentity type='win32' name='chrome.{dll_name}' "
+ "version='0.0.0.0' processorArchitecture='x86' language='*'/>"
+ "</dependentAssembly>"
+ "</dependency>".format(dll_name=name))
exe_manifest_dependencies = ''.join(exe_manifest_dependencies_list)