| Index: build/mac/tweak_info_plist.py
|
| diff --git a/build/mac/tweak_info_plist.py b/build/mac/tweak_info_plist.py
|
| index a6ffbcac0a8c5908ca51e2de7fe348a3d9b7c4d3..c1b829dee02414dec1b8f434de6148fc280956e5 100755
|
| --- a/build/mac/tweak_info_plist.py
|
| +++ b/build/mac/tweak_info_plist.py
|
| @@ -22,7 +22,6 @@
|
|
|
| import optparse
|
| import os
|
| -from os import environ as env
|
| import plistlib
|
| import re
|
| import subprocess
|
| @@ -202,6 +201,8 @@ def _RemoveKeystoneKeys(plist):
|
|
|
| def Main(argv):
|
| parser = optparse.OptionParser('%prog [options]')
|
| + parser.add_option('--plist', dest='plist_path', action='store',
|
| + type='string', default=None, help='The path of the plist to tweak.')
|
| parser.add_option('--breakpad', dest='use_breakpad', action='store',
|
| type='int', default=False, help='Enable Breakpad [1 or 0]')
|
| parser.add_option('--breakpad_uploads', dest='breakpad_uploads',
|
| @@ -224,9 +225,12 @@ def Main(argv):
|
| print >>sys.stderr, parser.get_usage()
|
| return 1
|
|
|
| + if not options.plist_path:
|
| + print >>sys.stderr, 'No --plist specified.'
|
| + return 1
|
| +
|
| # Read the plist into its parsed format.
|
| - DEST_INFO_PLIST = os.path.join(env['TARGET_BUILD_DIR'], env['INFOPLIST_PATH'])
|
| - plist = plistlib.readPlist(DEST_INFO_PLIST)
|
| + plist = plistlib.readPlist(options.plist_path)
|
|
|
| # Insert the product version.
|
| if not _AddVersionKeys(plist, version=options.version):
|
| @@ -251,8 +255,8 @@ def Main(argv):
|
| else:
|
| _RemoveBreakpadKeys(plist)
|
|
|
| - # Only add Keystone in Release builds.
|
| - if options.use_keystone and env['CONFIGURATION'] == 'Release':
|
| + # Add Keystone if configured to do so.
|
| + if options.use_keystone:
|
| if options.bundle_identifier is None:
|
| print >>sys.stderr, 'Use of Keystone requires the bundle id.'
|
| return 1
|
| @@ -270,7 +274,8 @@ def Main(argv):
|
|
|
| # Info.plist will work perfectly well in any plist format, but traditionally
|
| # applications use xml1 for this, so convert it to ensure that it's valid.
|
| - proc = subprocess.Popen(['plutil', '-convert', 'xml1', '-o', DEST_INFO_PLIST,
|
| + proc = subprocess.Popen(['plutil', '-convert', 'xml1',
|
| + '-o', options.plist_path,
|
| temp_info_plist.name])
|
| proc.wait()
|
| return proc.returncode
|
|
|