diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-03 23:37:25 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-03 23:37:25 +0000 |
commit | 366986e3ba2b792ca701689747900480fa36fbba (patch) | |
tree | 1817e520c041f707bd87f5f3d18be28abb4aff36 /build | |
parent | 5baaeb28091dd6c386ab6535fe9f8c41793976e1 (diff) | |
download | chromium_src-366986e3ba2b792ca701689747900480fa36fbba.zip chromium_src-366986e3ba2b792ca701689747900480fa36fbba.tar.gz chromium_src-366986e3ba2b792ca701689747900480fa36fbba.tar.bz2 |
Expand the Keystone tag to contain the system's CPU's bitness and whether a
full installer is desired.
Formerly, the tag identified only the channel that Chrome was on. The tag is
being enhanced to detect the CPU's bitness (adding "-32bit" for 32-bit-only,
non-64-bit-capable CPUs) and whether a full (as opposed to binary diff patch)
update is requested (adding "-full").
CPU bitness detection ought to be a feature of Keystone, but Keystone uses the
NXGetLocalArchInfo to determine the CPU type, and winds up always reporting
"i486". The "-32bit" tag suffix will be present whenever the
"hw.cpu64bit_capable" sysctl name is not found or has value 0. This enables
proper detection of users who are capable of running 64-bit Chrome on the
server side.
When a binary diff patch update application fails in dirpatcher, typically the
result of modifications made to existing installations, the "-full" tag suffix
will be set. On a subsequent update attempt, the server can detect this value
and provide the client with a full updater package, which does not depend on
the existing installation. The "-full" tag suffix is cleared on successful
update installation.
BUG=18323,54047,225352,303280,316916
R=thakis@chromium.org
Review URL: https://codereview.chromium.org/102963007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242964 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-x | build/mac/tweak_info_plist.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/build/mac/tweak_info_plist.py b/build/mac/tweak_info_plist.py index eb38ace..0f65e4a 100755 --- a/build/mac/tweak_info_plist.py +++ b/build/mac/tweak_info_plist.py @@ -204,6 +204,24 @@ 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') + assert tuple(sorted(components)) == components + + components_len = len(components) + combinations = 1 << components_len + tag_suffixes = [] + for combination in xrange(0, combinations): + tag_suffix = '' + for component_index in xrange(0, components_len): + if combination & (1 << component_index): + 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 +229,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: + plist['KSChannelID' + tag_suffix] = tag_suffix + def _RemoveKeystoneKeys(plist): """Removes any set Keystone keys.""" @@ -219,6 +242,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]') |