Bug 1455100 - Make devedition its own language pack addon id, by using MOZ_LANGPACK_EID again. r=nalexander, r=Pike, a=RyanVM
authorJustin Wood <Callek@gmail.com>
Thu, 19 Apr 2018 14:48:11 -0400
changeset 802287 164918e56cb9029ab6d72f535ba6955f8fbc9021
parent 802286 6983f5845e9bb0cc79ee9eafb017f41a652970ad
child 802288 34f8ad2b2793b07948c4a69682d76b192a4cc6cf
push id111850
push userbmo:tom@mozilla.com
push dateThu, 31 May 2018 16:41:37 +0000
reviewersnalexander, Pike, RyanVM
bugs1455100
milestone60.0.2
Bug 1455100 - Make devedition its own language pack addon id, by using MOZ_LANGPACK_EID again. r=nalexander, r=Pike, a=RyanVM MozReview-Commit-ID: z1SJmCQflq
browser/locales/Makefile.in
python/mozbuild/mozbuild/action/langpack_manifest.py
python/mozbuild/mozbuild/test/action/test_langpack_manifest.py
toolkit/locales/l10n.mk
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -15,17 +15,21 @@ SUBMAKEFILES += \
 # build non-default locales to non-default dist/ locations. Be aware!
 
 PWD := $(CURDIR)
 
 # These are defaulted to be compatible with the files the wget-en-US target
 # pulls. You may override them if you provide your own files.
 ZIP_IN ?= $(ABS_DIST)/$(PACKAGE)
 
+ifdef MOZ_DEV_EDITION
+MOZ_LANGPACK_EID=langpack-$(AB_CD)@devedition.mozilla.org
+else
 MOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox.mozilla.org
+endif
 # For Nightly, we know where to get the builds from to do local repacks
 ifdef NIGHTLY_BUILD
 export EN_US_BINARY_URL ?= https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central
 endif
 
 ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
 MOZ_PKG_MAC_DSSTORE=$(ABS_DIST)/branding/dsstore
 MOZ_PKG_MAC_BACKGROUND=$(ABS_DIST)/branding/background.png
--- a/python/mozbuild/mozbuild/action/langpack_manifest.py
+++ b/python/mozbuild/mozbuild/action/langpack_manifest.py
@@ -21,16 +21,17 @@ import mozversioncontrol
 import mozpack.path as mozpath
 from mozpack.chrome.manifest import (
     Manifest,
     ManifestLocale,
     parse_manifest,
 )
 from mozbuild.configure.util import Version
 from mozbuild.preprocessor import Preprocessor
+import buildconfig
 
 
 def write_file(path, content):
     with io.open(path, 'w', encoding='utf-8') as out:
         out.write(content + '\n')
 
 
 pushlog_api_url = "{0}/json-rev/{1}"
@@ -374,31 +375,31 @@ def get_version_maybe_buildid(min_versio
 #            }
 #        },
 #        'version': '57.0',
 #        'name': 'Polski Language Pack',
 #        ...
 #    }
 ###
 def create_webmanifest(locstr, min_app_ver, max_app_ver, app_name,
-                       l10n_basedir, defines, chrome_entries):
+                       l10n_basedir, langpack_eid, defines, chrome_entries):
     locales = map(lambda loc: loc.strip(), locstr.split(','))
     main_locale = locales[0]
 
     author = build_author_string(
         defines['MOZ_LANGPACK_CREATOR'],
         defines['MOZ_LANGPACK_CONTRIBUTORS'] if 'MOZ_LANGPACK_CONTRIBUTORS' in defines else ""
     )
 
     manifest = {
         'langpack_id': main_locale,
         'manifest_version': 2,
         'applications': {
             'gecko': {
-                'id': 'langpack-{0}@firefox.mozilla.org'.format(main_locale),
+                'id': langpack_eid,
                 'strict_min_version': min_app_ver,
                 'strict_max_version': max_app_ver,
             }
         },
         'name': '{0} Language Pack'.format(defines['MOZ_LANG_TITLE']),
         'description': 'Language pack for {0} for {1}'.format(app_name, main_locale),
         'version': get_version_maybe_buildid(min_app_ver),
         'languages': {},
@@ -441,16 +442,18 @@ def main(args):
     parser.add_argument('--min-app-ver',
                         help='Min version of the application the langpack is for')
     parser.add_argument('--max-app-ver',
                         help='Max version of the application the langpack is for')
     parser.add_argument('--app-name',
                         help='Name of the application the langpack is for')
     parser.add_argument('--l10n-basedir',
                         help='Base directory for locales used in the language pack')
+    parser.add_argument('--langpack-eid',
+                        help='Language pack id to use for this locale')
     parser.add_argument('--defines', default=[], nargs='+',
                         help='List of defines files to load data from')
     parser.add_argument('--input',
                         help='Langpack directory.')
 
     args = parser.parse_args(args)
 
     chrome_entries = []
@@ -471,16 +474,17 @@ def main(args):
             min_app_version = "{}.0".format(v.major)
 
     res = create_webmanifest(
         args.locales,
         min_app_version,
         args.max_app_ver,
         args.app_name,
         args.l10n_basedir,
+        args.langpack_eid,
         defines,
         chrome_entries
     )
     write_file(os.path.join(args.input, 'manifest.json'), res)
 
 
 if __name__ == '__main__':
     main(sys.argv[1:])
--- a/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py
+++ b/python/mozbuild/mozbuild/test/action/test_langpack_manifest.py
@@ -26,16 +26,17 @@ class TestGenerateManifest(unittest.Test
             <em:contributor>Mary White</em:contributor>
         """
         manifest = langpack_manifest.create_webmanifest(
             'fi',
             '57.0',
             '57.0.*',
             'Firefox',
             '/var/vcs/l10n-central',
+            'langpack-fi@firefox.mozilla.og',
             ctx,
             {},
         )
 
         data = json.loads(manifest)
         self.assertEquals(data['name'], 'Finnish Language Pack')
         self.assertEquals(
             data['author'], 'Suomennosprojekti (contributors: Joe Smith, Mary White)')
@@ -45,16 +46,17 @@ class TestGenerateManifest(unittest.Test
         ctx['MOZ_LANG_TITLE'] = 'Finnish'
         ctx['MOZ_LANGPACK_CREATOR'] = 'Suomennosprojekti'
         manifest = langpack_manifest.create_webmanifest(
             'fi',
             '57.0',
             '57.0.*',
             'Firefox',
             '/var/vcs/l10n-central',
+            'langpack-fi@firefox.mozilla.og',
             ctx,
             {},
         )
 
         data = json.loads(manifest)
         self.assertEquals(data['name'], 'Finnish Language Pack')
         self.assertEquals(data['author'], 'Suomennosprojekti')
 
--- a/toolkit/locales/l10n.mk
+++ b/toolkit/locales/l10n.mk
@@ -206,17 +206,17 @@ langpack-%:
 	@$(MAKE) libs-$(AB_CD)
 	@$(MAKE) package-langpack-$(AB_CD)
 
 package-langpack-%: LANGPACK_FILE=$(ABS_DIST)/$(PKG_LANGPACK_PATH)$(PKG_LANGPACK_BASENAME).xpi
 package-langpack-%: XPI_NAME=locale-$*
 package-langpack-%: AB_CD=$*
 package-langpack-%:
 	$(NSINSTALL) -D $(DIST)/$(PKG_LANGPACK_PATH)
-	$(call py_action,langpack_manifest,--locales $(AB_CD) --min-app-ver $(MOZ_APP_VERSION) --max-app-ver $(MOZ_APP_MAXVERSION) --app-name "$(MOZ_APP_DISPLAYNAME)" --l10n-basedir "$(L10NBASEDIR)" --defines $(LANGPACK_DEFINES) --input $(DIST)/xpi-stage/locale-$(AB_CD))
+	$(call py_action,langpack_manifest,--locales $(AB_CD) --min-app-ver $(MOZ_APP_VERSION) --max-app-ver $(MOZ_APP_MAXVERSION) --app-name "$(MOZ_APP_DISPLAYNAME)" --l10n-basedir "$(L10NBASEDIR)" --defines $(LANGPACK_DEFINES) --langpack-eid "$(MOZ_LANGPACK_EID)" --input $(DIST)/xpi-stage/locale-$(AB_CD))
 	$(call py_action,zip,-C $(DIST)/xpi-stage/locale-$(AB_CD) -x **/*.manifest -x **/*.js -x **/*.ini $(LANGPACK_FILE) $(PKG_ZIP_DIRS) manifest.json)
 
 # This variable is to allow the wget-en-US target to know which ftp server to download from
 ifndef EN_US_BINARY_URL 
 EN_US_BINARY_URL = $(error You must set EN_US_BINARY_URL)
 endif
 # In taskcluster the installer comes from another location
 ifndef EN_US_INSTALLER_BINARY_URL