summaryrefslogtreecommitdiffstats
path: root/chrome/tools/build/win/create_installer_archive.py
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 12:46:38 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 12:46:38 +0000
commitf0a51fb571f46531025fa09240bbc3e1af925e84 (patch)
tree558b4f0e737fda4b9ab60f252c9c23b8a4ca523e /chrome/tools/build/win/create_installer_archive.py
parent6390be368205705f49ead3cec40396519f13b889 (diff)
downloadchromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.zip
chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.tar.gz
chromium_src-f0a51fb571f46531025fa09240bbc3e1af925e84.tar.bz2
Fixes CRLF and trailing white spaces.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools/build/win/create_installer_archive.py')
-rwxr-xr-xchrome/tools/build/win/create_installer_archive.py44
1 files changed, 22 insertions, 22 deletions
diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py
index 61579ae..cf6d846 100755
--- a/chrome/tools/build/win/create_installer_archive.py
+++ b/chrome/tools/build/win/create_installer_archive.py
@@ -5,11 +5,11 @@
"""Script to create Chrome Installer archive.
- This script is used to create an archive of all the files required for a
+ This script is used to create an archive of all the files required for a
Chrome install in appropriate directory structure. It reads chrome.release
- file as input, creates chrome.7z archive, compresses setup.exe and
- generates packed_files.txt for mini_installer project.
-
+ file as input, creates chrome.7z archive, compresses setup.exe and
+ generates packed_files.txt for mini_installer project.
+
"""
import ConfigParser
@@ -33,13 +33,13 @@ BSDIFF_EXEC = "bsdiff.exe"
VERSION_FILE = "VERSION"
PACKED_FILE_COMMENTS = """
// This file is automatically generated by create_installer_archive.py.
-// It contains the resource entries that are going to be linked inside
-// mini_installer.exe. For each file to be linked there should be two
+// It contains the resource entries that are going to be linked inside
+// mini_installer.exe. For each file to be linked there should be two
// lines:
// - The first line contains the output filename (without path) and the
-// type of the resource ('BN' means the file is not compressed and
+// type of the resource ('BN' means the file is not compressed and
// 'BL' means the file is compressed.
-// - The second line contains the path to the input file. Uses '/' to
+// - The second line contains the path to the input file. Uses '/' to
// separate path components.
"""
@@ -71,7 +71,7 @@ def Readconfig(output_dir, input_file, current_version):
"""
variables = {}
variables['ChromeDir'] = CHROME_DIR
- variables['VersionDir'] = os.path.join(variables['ChromeDir'],
+ variables['VersionDir'] = os.path.join(variables['ChromeDir'],
current_version)
config = ConfigParser.SafeConfigParser(variables)
config.read(input_file)
@@ -131,7 +131,7 @@ def CreateArchiveFile(output_dir, staging_dir, current_version,
lzma_exec = os.path.join(output_dir, "..", "..", "third_party",
"lzma_sdk", "Executable", "7za.exe")
archive_file = os.path.join(output_dir, FULL_ARCHIVE_FILE)
- cmd = '%s a -t7z "%s" "%s" -mx0' % (lzma_exec, archive_file,
+ cmd = '%s a -t7z "%s" "%s" -mx0' % (lzma_exec, archive_file,
os.path.join(staging_dir, CHROME_DIR))
# There doesnt seem to be any way in 7za.exe to override existing file so
# we always delete before creating a new one.
@@ -147,7 +147,7 @@ def CreateArchiveFile(output_dir, staging_dir, current_version,
if (prev_version_dir):
prev_archive_file = os.path.join(prev_version_dir, FULL_ARCHIVE_FILE)
patch_file = os.path.join(output_dir, "patch.7z")
- cmd = '%s "%s" "%s" "%s"' % (os.path.join(output_dir, BSDIFF_EXEC),
+ cmd = '%s "%s" "%s" "%s"' % (os.path.join(output_dir, BSDIFF_EXEC),
prev_archive_file, archive_file, patch_file)
RunSystemCommand(cmd)
@@ -158,7 +158,7 @@ def CreateArchiveFile(output_dir, staging_dir, current_version,
orig_file = archive_file
compressed_archive_file_path = os.path.join(output_dir, archive_file_name)
- cmd = '%s a -t7z "%s" "%s" -mx9' % (lzma_exec, compressed_archive_file_path,
+ cmd = '%s a -t7z "%s" "%s" -mx9' % (lzma_exec, compressed_archive_file_path,
orig_file)
if os.path.exists(compressed_archive_file_path):
os.remove(compressed_archive_file_path)
@@ -169,7 +169,7 @@ def CreateArchiveFile(output_dir, staging_dir, current_version,
def CompressSetupExec(output_dir):
"""Compresses setup.exe to reduce size."""
- cmd = 'makecab.exe /V1 /L "%s" "%s"' % (output_dir,
+ cmd = 'makecab.exe /V1 /L "%s" "%s"' % (output_dir,
os.path.join(output_dir, SETUP_EXEC))
RunSystemCommand(cmd)
@@ -181,15 +181,15 @@ def GetFileMD5Hash(file):
return hash
-def CreateResourceInputFile(output_dir,
+def CreateResourceInputFile(output_dir,
prev_version_dir, archive_file_name):
"""Creates resource input file (packed_files.txt) for mini_installer project.
-
+
This method checks if we are generating a patch instead of full installer. In
case of patch it also checks if setup.exe has changed by comparing its
MD5 hash with the MD5 hash of previous setup.exe. If hash values are same
setup.exe is not included in packed_files.txt.
-
+
In case of patch we include patch.7z and in case of full
installer we include chrome.7z in packed_files.txt.
"""
@@ -199,13 +199,13 @@ def CreateResourceInputFile(output_dir,
prev_hash = GetFileMD5Hash(os.path.join(prev_version_dir, SETUP_EXEC))
if (current_hash == prev_hash):
setup_exe_needed = 0
-
+
if (setup_exe_needed):
CompressSetupExec(output_dir)
c_setup_file = SETUP_EXEC[:len(SETUP_EXEC) - 1] + "_"
- setup_file_entry = "%s\t\tBL\n\"%s\"" % (c_setup_file,
+ setup_file_entry = "%s\t\tBL\n\"%s\"" % (c_setup_file,
os.path.join(output_dir, c_setup_file).replace("\\","/"))
-
+
archive_file_entry = "\n%s\t\tB7\n\"%s\"" % (archive_file_name,
os.path.join(output_dir, archive_file_name).replace("\\","/"))
output_file = os.path.join(output_dir, MINI_INSTALLER_INPUT_FILE)
@@ -231,7 +231,7 @@ def main(options):
CopyAllFilesToStagingDir(config, options.distribution,
staging_dir, options.output_dir)
-
+
# Name of the archive file built (for example - chrome.7z or
# patch-<old_version>-<new_version>.7z or patch-<new_version>.7z
archive_file_name = CreateArchiveFile(options.output_dir, staging_dir,
@@ -250,11 +250,11 @@ if '__main__' == __name__:
help='Name of Chromium Distribution. Optional.')
option_parser.add_option('-s', '--skip_rebuild_archive',
default="False", help='Skip re-building Chrome.7z archive if it exists.')
- option_parser.add_option('-l', '--last_chrome_installer',
+ option_parser.add_option('-l', '--last_chrome_installer',
help='Generate differential installer. The value of this parameter ' +
'specifies the directory that contains base versions of ' +
'setup.exe & chrome.7z.')
- option_parser.add_option('-v', '--last_chrome_version',
+ option_parser.add_option('-v', '--last_chrome_version',
help='Version of the previous installer. ' +
'Used only for the purpose of naming archive file. Optional.')