gecko/toolkit/mozapps/installer/l10n-repack.py
Axel Hecht 049f495018 bug 848830, fix regression in app updater localization, r=glandium, rstrong
--HG--
extra : rebase_source : 66b4e3e55a05d4b74bd39a40c4768c620b74062a
2013-08-13 17:15:42 +02:00

49 lines
1.4 KiB
Python

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''
Replace localized parts of a packaged directory with data from a langpack
directory.
'''
from mozpack.packager import l10n
from argparse import ArgumentParser
import buildconfig
# Set of files or directories not listed in a chrome.manifest but that are
# localized.
NON_CHROME = set([
'**/crashreporter*.ini',
'searchplugins',
'dictionaries',
'hyphenation',
'defaults/profile',
'defaults/pref*/*-l10n.js',
'update.locale',
'updater.ini',
'extensions/langpack-*@*',
'distribution/extensions/langpack-*@*',
'chrome/**/searchplugins/*.xml',
])
def main():
parser = ArgumentParser()
parser.add_argument('build',
help='Directory containing the build to repack')
parser.add_argument('l10n',
help='Directory containing the staged langpack')
parser.add_argument('--non-resource', nargs='+', metavar='PATTERN',
default=[],
help='Extra files not to be considered as resources')
args = parser.parse_args()
buildconfig.substs['USE_ELF_HACK'] = False
buildconfig.substs['PKG_SKIP_STRIP'] = True
l10n.repack(args.build, args.l10n, args.non_resource, NON_CHROME)
if __name__ == "__main__":
main()