Bug 846740 - Treat chrome searchplugins as non-chrome when doing l10n-repack. r=gps, a=bajaj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 06 Mar 2013 07:28:41 +0100
changeset 132320 9d56b37f1749567f4363b74e9978d777ae378e6b
parent 132319 d2e33291adcd4716a8f5b0084cb32d9967c9be4a
child 132321 8dd5efd73b68eb11a9d0a336b4a4515f474e16e1
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, bajaj
bugs846740
milestone21.0a2
Bug 846740 - Treat chrome searchplugins as non-chrome when doing l10n-repack. r=gps, a=bajaj
python/mozbuild/mozpack/test/test_packager_l10n.py
toolkit/mozapps/installer/l10n-repack.py
--- a/python/mozbuild/mozpack/test/test_packager_l10n.py
+++ b/python/mozbuild/mozpack/test/test_packager_l10n.py
@@ -19,21 +19,23 @@ from mozpack.copier import FileRegistry
 from mozpack.packager.formats import FlatFormatter
 
 
 class TestL10NRepack(unittest.TestCase):
     def test_l10n_repack(self):
         foo = GeneratedFile('foo')
         foobar = GeneratedFile('foobar')
         qux = GeneratedFile('qux')
+        bar = GeneratedFile('bar')
         baz = GeneratedFile('baz')
         dict_aa = GeneratedFile('dict_aa')
         dict_bb = GeneratedFile('dict_bb')
         dict_cc = GeneratedFile('dict_cc')
         barbaz = GeneratedFile('barbaz')
+        lst = GeneratedFile('foo\nbar')
         app_finder = MockFinder({
             'bar/foo': foo,
             'chrome/foo/foobar': foobar,
             'chrome/qux/qux.properties': qux,
             'chrome/qux/baz/baz.properties': baz,
             'chrome/chrome.manifest': ManifestFile('chrome', [
                 ManifestContent('chrome', 'foo', 'foo/'),
                 ManifestLocale('chrome', 'qux', 'en-US', 'qux/'),
@@ -44,22 +46,27 @@ class TestL10NRepack(unittest.TestCase):
             'app/chrome/bar/barbaz.dtd': barbaz,
             'app/chrome/chrome.manifest': ManifestFile('app/chrome', [
                 ManifestLocale('app/chrome', 'bar', 'en-US', 'bar/')
             ]),
             'app/chrome.manifest':
             ManifestFile('app', [Manifest('app', 'chrome/chrome.manifest')]),
             'app/dict/bb': dict_bb,
             'app/dict/cc': dict_cc,
+            'app/chrome/bar/search/foo.xml': foo,
+            'app/chrome/bar/search/bar.xml': bar,
+            'app/chrome/bar/search/lst.txt': lst,
         })
         app_finder.jarlogs = {}
         app_finder.base = 'app'
+        foo_l10n = GeneratedFile('foo_l10n')
         qux_l10n = GeneratedFile('qux_l10n')
         baz_l10n = GeneratedFile('baz_l10n')
         barbaz_l10n = GeneratedFile('barbaz_l10n')
+        lst_l10n = GeneratedFile('foo\nqux')
         l10n_finder = MockFinder({
             'chrome/qux-l10n/qux.properties': qux_l10n,
             'chrome/qux-l10n/baz/baz.properties': baz_l10n,
             'chrome/chrome.manifest': ManifestFile(' chrome', [
                 ManifestLocale('chrome', 'qux', 'x-test', 'qux-l10n/'),
             ]),
             'chrome.manifest':
             ManifestFile('', [Manifest('', 'chrome/chrome.manifest')]),
@@ -67,22 +74,26 @@ class TestL10NRepack(unittest.TestCase):
             'dict/cc': dict_cc,
             'app/chrome/bar-l10n/barbaz.dtd': barbaz_l10n,
             'app/chrome/chrome.manifest': ManifestFile('app/chrome', [
                 ManifestLocale('app/chrome', 'bar', 'x-test', 'bar-l10n/')
             ]),
             'app/chrome.manifest':
             ManifestFile('app', [Manifest('app', 'chrome/chrome.manifest')]),
             'app/dict/aa': dict_aa,
+            'app/chrome/bar-l10n/search/foo.xml': foo_l10n,
+            'app/chrome/bar-l10n/search/qux.xml': qux_l10n,
+            'app/chrome/bar-l10n/search/lst.txt': lst_l10n,
         })
         l10n_finder.base = 'l10n'
         copier = FileRegistry()
         formatter = FlatFormatter(copier)
 
-        l10n._repack(app_finder, l10n_finder, copier, formatter, ['dict'])
+        l10n._repack(app_finder, l10n_finder, copier, formatter,
+                     ['dict', 'chrome/**/search/*.xml'])
         self.maxDiff = None
 
         repacked = {
             'bar/foo': foo,
             'chrome/foo/foobar': foobar,
             'chrome/qux-l10n/qux.properties': qux_l10n,
             'chrome/qux-l10n/baz/baz.properties': baz_l10n,
             'chrome/chrome.manifest': ManifestFile('chrome', [
@@ -95,16 +106,19 @@ class TestL10NRepack(unittest.TestCase):
             'dict/cc': dict_cc,
             'app/chrome/bar-l10n/barbaz.dtd': barbaz_l10n,
             'app/chrome/chrome.manifest': ManifestFile('app/chrome', [
                 ManifestLocale('app/chrome', 'bar', 'x-test', 'bar-l10n/')
             ]),
             'app/chrome.manifest':
             ManifestFile('app', [Manifest('app', 'chrome/chrome.manifest')]),
             'app/dict/aa': dict_aa,
+            'app/chrome/bar-l10n/search/foo.xml': foo_l10n,
+            'app/chrome/bar-l10n/search/qux.xml': qux_l10n,
+            'app/chrome/bar-l10n/search/lst.txt': lst_l10n,
         }
 
         self.assertEqual(
             dict((p, f.open().read()) for p, f in copier),
             dict((p, f.open().read()) for p, f in repacked.iteritems())
         )
 
 
--- a/toolkit/mozapps/installer/l10n-repack.py
+++ b/toolkit/mozapps/installer/l10n-repack.py
@@ -18,16 +18,17 @@ NON_CHROME = set([
     'searchplugins',
     'dictionaries',
     'hyphenation',
     'defaults/profile',
     'defaults/pref*/*-l10n.js',
     'update.locale',
     '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',