From: Serhiy Storchaka Date: Thu, 2 Oct 2014 07:21:43 +0000 (+0300) Subject: Issue #20076: Apply optimization in makelocalealias.py repeatedly. X-Git-Tag: v3.5.0a1~784 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5189ee54cf6fec9f00e0df1ebdeea5cbaef3e18e;p=python Issue #20076: Apply optimization in makelocalealias.py repeatedly. Remove just added the sr_rs.utf8@latn alias because it is derived from sr_rs@latin. --- 5189ee54cf6fec9f00e0df1ebdeea5cbaef3e18e diff --cc Tools/i18n/makelocalealias.py index 980465b42c,10887ce338..25cb337b96 --- a/Tools/i18n/makelocalealias.py +++ b/Tools/i18n/makelocalealias.py @@@ -120,20 -92,9 +120,25 @@@ def check(data) return errors if __name__ == '__main__': + import argparse + parser = argparse.ArgumentParser() + parser.add_argument('--locale-alias', default=LOCALE_ALIAS, + help='location of the X11 alias file ' + '(default: %a)' % LOCALE_ALIAS) + parser.add_argument('--glibc-supported', + help='location of the glibc SUPPORTED locales file') + args = parser.parse_args() + data = locale.locale_alias.copy() - data.update(parse(LOCALE_ALIAS)) - data = optimize(data) + if args.glibc_supported: + data.update(parse_glibc_supported(args.glibc_supported)) + data.update(parse(args.locale_alias)) - data = optimize(data) ++ while True: ++ # Repeat optimization while the size is decreased. ++ n = len(data) ++ data = optimize(data) ++ if len(data) == n: ++ break print_differences(data, locale.locale_alias) print() print('locale_alias = {')