Backout changeset 4c8d59b07d16 (bug 833882) for l10n bustage
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 25 Jan 2013 00:41:46 +0100
changeset 119744 169e0492b03b682c263052e45802a4efc88c5bbc
parent 119743 6e3ed198bcacf1917d8616d06282787418471426
child 119751 d0c3b13e956ea7d9e6b2d7996e05081bda09197d
push id24222
push usermh@glandium.org
push dateThu, 24 Jan 2013 23:43:13 +0000
treeherdermozilla-central@169e0492b03b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs833882
milestone21.0a1
backs out4c8d59b07d1676d070367e1216e524944ea8dc54
first release with
nightly linux32
169e0492b03b / 21.0a1 / 20130124162801 / files
nightly linux64
169e0492b03b / 21.0a1 / 20130124162801 / files
nightly mac
169e0492b03b / 21.0a1 / 20130124162801 / files
nightly win32
169e0492b03b / 21.0a1 / 20130124162801 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Backout changeset 4c8d59b07d16 (bug 833882) for l10n bustage
toolkit/mozapps/installer/l10n-repack.py
--- a/toolkit/mozapps/installer/l10n-repack.py
+++ b/toolkit/mozapps/installer/l10n-repack.py
@@ -107,42 +107,43 @@ def repack(source, l10n, non_resources=[
 
     # For chrome and non chrome files or directories, store what langpack path
     # corresponds to a package path.
     paths = dict((e.path,
                   l10n_paths[mozpack.path.basedir(e.path, bases)][e.name])
                  for e in entries if isinstance(e, ManifestEntryWithRelPath))
 
     for path in NON_CHROME:
-        left = set(p for p, f in finder.find(path))
-        right = set(p for p, f in l10n_finder.find(path))
-        for p in right:
+        for p, f in l10n_finder.find(path):
             paths[p] = p
-        for p in left - right:
-            paths[p] = None
 
     # Create a new package, with non localized bits coming from the original
     # package, and localized bits coming from the langpack.
     packager = SimplePackager(formatter)
     for p, f in finder:
         if is_manifest(p):
             # Remove localized manifest entries.
             for e in [e for e in f if e.localized]:
                 f.remove(e)
-        if p in paths:
-            path = paths[p]
-            if path:
-                # If the path is one that needs a locale replacement, use the
-                # corresponding file from the langpack.
+        base = mozpack.path.basedir(p, paths.keys())
+        if base:
+            # If the path is one that needs a locale replacement, use the
+            # corresponding file from the langpack.
+            subpath = mozpack.path.relpath(p, base)
+            path = mozpack.path.normpath(mozpack.path.join(paths[base],
+                                                           subpath))
+            files = [f for p, f in l10n_finder.find(path)]
+            if len(files) == 0 and base in NON_CHROME:
+                path = path.replace(locale, l10n_locale)
                 files = [f for p, f in l10n_finder.find(path)]
-                if not len(files):
-                    if base not in NON_CHROME:
-                        errors.error("Missing file: %s" % os.path.join(l10n, path))
-                else:
-                    packager.add(path, files[0])
+            if len(files) == 0:
+                if not base in NON_CHROME:
+                    errors.error("Missing file: %s" % os.path.join(l10n, path))
+            else:
+                packager.add(path, files[0])
         else:
             packager.add(p, f)
 
     # Add localized manifest entries from the langpack.
     l10n_manifests = []
     for base in set(e.base for e in l10n_entries):
         m = ManifestFile(base)
         for e in l10n_entries: