toolkit/mozapps/installer/l10n-repack.py

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 # This Source Code Form is subject to the terms of the Mozilla Public
     2 # License, v. 2.0. If a copy of the MPL was not distributed with this
     3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     5 '''
     6 Replace localized parts of a packaged directory with data from a langpack
     7 directory.
     8 '''
    10 from mozpack.packager import l10n
    11 from argparse import ArgumentParser
    12 import buildconfig
    14 # Set of files or directories not listed in a chrome.manifest but that are
    15 # localized.
    16 NON_CHROME = set([
    17     '**/crashreporter*.ini',
    18     'searchplugins',
    19     'dictionaries',
    20     'hyphenation',
    21     'defaults/profile',
    22     'defaults/pref*/*-l10n.js',
    23     'update.locale',
    24     'updater.ini',
    25     'extensions/langpack-*@*',
    26     'distribution/extensions/langpack-*@*',
    27     'chrome/**/searchplugins/*.xml',
    28 ])
    31 def main():
    32     parser = ArgumentParser()
    33     parser.add_argument('build',
    34                         help='Directory containing the build to repack')
    35     parser.add_argument('l10n',
    36                         help='Directory containing the staged langpack')
    37     parser.add_argument('--non-resource', nargs='+', metavar='PATTERN',
    38                         default=[],
    39                         help='Extra files not to be considered as resources')
    40     args = parser.parse_args()
    42     buildconfig.substs['USE_ELF_HACK'] = False
    43     buildconfig.substs['PKG_SKIP_STRIP'] = True
    44     l10n.repack(args.build, args.l10n, args.non_resource, NON_CHROME)
    47 if __name__ == "__main__":
    48     main()

mercurial