Index: build/mac/tweak_info_plist.py |
diff --git a/build/mac/tweak_info_plist.py b/build/mac/tweak_info_plist.py |
index eb38acea4e27ff669b6e56492632e8b3744324e6..1abaaa1d741066bf54e22c46bc3362b8a6a60a55 100755 |
--- a/build/mac/tweak_info_plist.py |
+++ b/build/mac/tweak_info_plist.py |
@@ -204,6 +204,23 @@ def _RemoveBreakpadKeys(plist): |
'BreakpadSkipConfirm') |
+def _TagSuffixes(): |
+ # Keep this list sorted in the order that tag suffix components are to |
+ # appear in a tag value. That is to say, it should be sorted per ASCII. |
+ components = ('32bit', 'full') |
Nico
2014/01/02 23:56:28
assert sorted(components) == components
Mark Mentovai
2014/01/03 16:46:41
Nico wrote:
|
+ |
+ components_len = len(components) |
+ combinations = 1 << components_len |
+ tag_suffixes = [] |
+ for combination in xrange(0, combinations): |
Nico
2014/01/02 23:56:28
start this at 1…
Mark Mentovai
2014/01/03 16:46:41
Nico wrote:
|
+ tag_suffix = '' |
+ for component_index in xrange(0, components_len): |
+ if combination & 1 << component_index: |
TVL
2014/01/03 00:09:40
do you want parens in here to be safe?
|
+ tag_suffix += '-' + components[component_index] |
+ tag_suffixes.append(tag_suffix) |
+ return tag_suffixes |
+ |
+ |
def _AddKeystoneKeys(plist, bundle_identifier): |
"""Adds the Keystone keys. This must be called AFTER _AddVersionKeys() and |
also requires the |bundle_identifier| argument (com.example.product).""" |
@@ -211,6 +228,11 @@ def _AddKeystoneKeys(plist, bundle_identifier): |
plist['KSProductID'] = bundle_identifier |
plist['KSUpdateURL'] = 'https://tools.google.com/service/update2' |
+ _RemoveKeys(plist, 'KSChannelID') |
+ for tag_suffix in _TagSuffixes(): |
+ if tag_suffix: |
Nico
2014/01/02 23:56:28
…and remove this if
Also, this always adds all k
Mark Mentovai
2014/01/03 16:46:41
Nico wrote:
|
+ plist['KSChannelID' + tag_suffix] = tag_suffix |
+ |
def _RemoveKeystoneKeys(plist): |
"""Removes any set Keystone keys.""" |
@@ -219,6 +241,11 @@ def _RemoveKeystoneKeys(plist): |
'KSProductID', |
'KSUpdateURL') |
+ tag_keys = [] |
+ for tag_suffix in _TagSuffixes(): |
+ tag_keys.append('KSChannelID' + tag_suffix) |
+ _RemoveKeys(plist, *tag_keys) |
+ |
def Main(argv): |
parser = optparse.OptionParser('%prog [options]') |