stages/rpm: new option to set _install_langs

RPM supports installing only specific locales by setting the
`_install_langs` macro.
This commit is contained in:
Christian Kellner 2022-06-29 19:42:35 +02:00 committed by Tom Gundersen
parent a6e7070b13
commit 34ebe60bf0

View file

@ -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()