[Git][reproducible-builds/reprotest][master] 3 commits: Support passing --vary=locales.locale=LOCALE to specify locale to
Vagrant Cascadian (@vagrant)
gitlab at salsa.debian.org
Mon Feb 20 00:22:14 UTC 2023
Vagrant Cascadian pushed to branch master at Reproducible Builds / reprotest
Commits:
a92f741b by Vagrant Cascadian at 2023-02-17T17:30:13-08:00
Support passing --vary=locales.locale=LOCALE to specify locale to
vary.
- - - - -
84496fa5 by Holger Levsen at 2023-02-18T13:34:49+01:00
drop TODO comment it was implemented with the previous commit, a92f741b
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
b2a6f6ff by Holger Levsen at 2023-02-18T13:40:37+01:00
mention interesting locales in README
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2 changed files:
- README.rst
- reprotest/build.py
Changes:
=====================================
README.rst
=====================================
@@ -288,6 +288,13 @@ time.faketimes
Note that the clock continues to run during the build. It is possible for
``faketime(1)`` to freeze it, but we don't yet support that yet; it has a
higher chance of causing your build to fail or misbehave.
+locales.locale
+ A semicolon-separated list one or more locales to test when
+ performing locales variations.
+ If multiple locales are specified, one will be chosen at random.
+ Some more interesting locales are fr_CH.UTF-8, ru_RU.CP1251, kk_KZ.RK1048
+ or zh_CN.
+ Default is et_EE.UTF-8 if unspecified.
The difference between --vary and --variations is that the former appends onto
previous values but the latter resets them. Furthermore, the last value set for
=====================================
reprotest/build.py
=====================================
@@ -367,9 +367,10 @@ def locales(ctx, build, vary):
if not vary:
return build.add_env('LANG', 'C.UTF-8').add_env('LANGUAGE', 'en_US:en')
else:
- # TODO: support specifying locale to vary
# Use an Estonian locale by default, which has interesting sort order for ASCII characters
loc = 'et_EE.UTF-8'
+ if ctx.spec.locales.locale:
+ loc = random.choice(ctx.spec.locales.locale)
if ctx.verbosity >= 1:
logger.info("LOCALE variation: LC_ALL = " + loc + " LANGUAGE = " + loc + ":fr")
return build.add_env('LANG', loc).add_env('LC_ALL', loc).add_env('LANGUAGE', '%s:fr' % loc)
@@ -576,6 +577,10 @@ class DomainHostVariation(collections.namedtuple('_DomainHostVariation', 'use_su
def default(cls):
return cls(0)
+class LocalesVariation(collections.namedtuple('_LocaleVariation', 'locale')):
+ @classmethod
+ def default(cls):
+ return cls(mdiffconf.strlist_set(";"))
class VariationSpec(mdiffconf.ImmutableNamespace):
@classmethod
@@ -585,6 +590,7 @@ class VariationSpec(mdiffconf.ImmutableNamespace):
"user_group": UserGroupVariation.default(),
"time": TimeVariation.default(),
"domain_host": DomainHostVariation.default(),
+ "locales": LocalesVariation.default(),
}
return cls(**{k: default_overrides.get(k, True) for k in variations})
View it on GitLab: https://salsa.debian.org/reproducible-builds/reprotest/-/compare/610e6cae15fe8d066303694af97bf3a09a6b01c2...b2a6f6ffee10a2558b28908ef7568e4aec397b80
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/reprotest/-/compare/610e6cae15fe8d066303694af97bf3a09a6b01c2...b2a6f6ffee10a2558b28908ef7568e4aec397b80
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20230220/244c1496/attachment.htm>
More information about the rb-commits
mailing list