Bug 1455337 - Set min version appropriately for language packs. r=gps, a=testing
authorJustin Wood callek@mozilla.com
Tue, 15 May 2018 19:12:29 -0700
changeset 463631 ea9a60e5c79e
parent 463630 79bfebd1166d
child 463632 03d4f76300be
push id1718
push userjlund@mozilla.com
push date2018-05-16 02:18 +0000
treeherdermozilla-release@ea9a60e5c79e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, testing
bugs1455337
milestone60.0.1
Bug 1455337 - Set min version appropriately for language packs. r=gps, a=testing
python/mozbuild/mozbuild/action/langpack_manifest.py
--- a/python/mozbuild/mozbuild/action/langpack_manifest.py
+++ b/python/mozbuild/mozbuild/action/langpack_manifest.py
@@ -19,16 +19,17 @@ import datetime
 import requests
 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
 
 
 def write_file(path, content):
     with io.open(path, 'w', encoding='utf-8') as out:
         out.write(content + '\n')
 
 
@@ -453,19 +454,30 @@ def main(args):
     args = parser.parse_args(args)
 
     chrome_entries = []
     parse_chrome_manifest(
         os.path.join(args.input, 'chrome.manifest'), args.input, chrome_entries)
 
     defines = parse_defines(args.defines)
 
+    min_app_version = args.min_app_version
+    if 'a' not in min_app_version:  # Don't mangle alpha versions
+        v = Version(min_app_version)
+        if args.app_name == "SeaMonkey":
+            # SeaMonkey is odd in that <major> hasn't changed for many years.
+            # So min is <major>.<minor>.0
+            min_app_version = "{}.{}.0".format(v.major, v.minor)
+        else:
+            # Language packs should be minversion of {major}.0
+            min_app_version = "{}.0".format(v.major)
+
     res = create_webmanifest(
         args.locales,
-        args.min_app_ver,
+        min_app_version,
         args.max_app_ver,
         args.app_name,
         args.l10n_basedir,
         defines,
         chrome_entries
     )
     write_file(os.path.join(args.input, 'manifest.json'), res)