Bug 1395456 - Use MOZ_APP_MAXVERSION for strict_max_version in langpack manifest. r=Pike

MozReview-Commit-ID: 63BQQt4U8if

--HG--
extra : rebase_source : faf796d214298fa50e0d73a82a7b1a4d0e91de30
This commit is contained in:
Zibi Braniecki 2017-08-31 11:54:26 -07:00
Родитель ea04a12a69
Коммит 55a7b70e19
2 изменённых файлов: 16 добавлений и 10 удалений

Просмотреть файл

@ -219,7 +219,9 @@ def parse_chrome_manifest(path, base_path, chrome_entries):
# locstr (str) - A string with a comma separated list of locales
# for which resources are embedded in the
# language pack
# appver (str) - A version of the application the language
# min_app_ver (str) - A minimum version of the application the language
# resources are for
# max_app_ver (str) - A maximum version of the application the language
# resources are for
# defines (dict) - A dictionary of defines entries
# chrome_entries (dict) - A dictionary of chrome registry entries
@ -232,6 +234,7 @@ def parse_chrome_manifest(path, base_path, chrome_entries):
# ['pl'],
# '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}',
# '57.0',
# '57.0.*',
# {'MOZ_LANG_TITLE': 'Polski'},
# chrome_entries
# )
@ -266,7 +269,7 @@ def parse_chrome_manifest(path, base_path, chrome_entries):
# ...
# }
###
def create_webmanifest(locstr, appver, defines, chrome_entries):
def create_webmanifest(locstr, min_app_ver, max_app_ver, defines, chrome_entries):
locales = map(lambda loc: loc.strip(), locstr.split(','))
main_locale = locales[0]
@ -281,13 +284,13 @@ def create_webmanifest(locstr, appver, defines, chrome_entries):
'applications': {
'gecko': {
'id': 'langpack-{0}@firefox.mozilla.org'.format(main_locale),
'strict_min_version': appver,
'strict_max_version': '{0}.*'.format(appver)
'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 Firefox for {0}'.format(main_locale),
'version': appver,
'version': min_app_ver,
'languages': {},
'author': author
}
@ -309,7 +312,7 @@ def create_webmanifest(locstr, appver, defines, chrome_entries):
for loc in locales:
manifest['languages'][loc] = {
'version': appver,
'version': min_app_ver,
'resources': None,
'chrome_resources': cr
}
@ -321,8 +324,10 @@ def main(args):
parser = argparse.ArgumentParser()
parser.add_argument('--locales',
help='List of language codes provided by the langpack')
parser.add_argument('--appver',
help='Version of the application the langpack is for')
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('--defines', default=[], nargs='+',
help='List of defines files to load data from')
parser.add_argument('--input',
@ -338,7 +343,8 @@ def main(args):
res = create_webmanifest(
args.locales,
args.appver,
args.min_app_ver,
args.max_app_ver,
defines,
chrome_entries
)

Просмотреть файл

@ -207,7 +207,7 @@ package-langpack-%: AB_CD=$*
package-langpack-%:
$(NSINSTALL) -D $(DIST)/$(PKG_LANGPACK_PATH)
ifdef WEBEXT_LANGPACKS
$(call py_action,langpack_manifest,--locales $(AB_CD) --appver $(MOZ_APP_VERSION) --defines $(NEW_APP_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) --defines $(NEW_APP_DEFINES) --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)
else
$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) \