From 34ebe60bf076c3a147b82d9d3a0fec01fe4de11c Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 29 Jun 2022 19:42:35 +0200 Subject: [PATCH] stages/rpm: new option to set `_install_langs` RPM supports installing only specific locales by setting the `_install_langs` macro. --- stages/org.osbuild.rpm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stages/org.osbuild.rpm b/stages/org.osbuild.rpm index 22dbb36a..19798749 100755 --- a/stages/org.osbuild.rpm +++ b/stages/org.osbuild.rpm @@ -133,6 +133,15 @@ SCHEMA_2 = """ "default": false } } + }, + "install_langs": { + "description": "Only install certain locales (sets `_install_langs` RPM macro)", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string" + } } } }, @@ -282,6 +291,14 @@ def main(tree, inputs, options): if no_dracut: masked_files = disable_dracut(tree) + langs = options.get("install_langs") + if langs: + macro = "%_install_langs " + ":".join(langs) + print(f"using '{macro}'") + extra_args += [ + "--define", macro, + ] + with tempfile.NamedTemporaryFile(prefix="manifest.", mode='w') as manifest: manifest.writelines(c+'\n' for c in packages) manifest.flush()