compose: Support 'install-langs'

This should exist for the same reason the yum and RPM options do; some
people want to construct more minimal systems.
This commit is contained in:
Colin Walters 2014-11-13 20:39:42 -05:00
parent e2db99a1fb
commit 80300ba7c8
2 changed files with 23 additions and 0 deletions

View File

@ -27,6 +27,9 @@ Treefile
set; rpm-ostree will modify the `/etc/nsswitch.conf` in the target
root to ensure that `/usr/lib/passwd` is used.
* `install-langs`: Array of strings, optional. This sets the RPM
_install_langs macro. Set this to e.g. `["en_US", "fr_FR"]`.
* `packages`: Array of strings, mandatory: Set of installed packages.
Names prefixed with an `@` (e.g. `@core`) are taken to be the names
of comps groups.

View File

@ -315,6 +315,7 @@ yum_context_new (RpmOstreeTreeComposeContext *self,
{
gboolean success = FALSE;
YumContext *yumctx = NULL;
JsonNode *install_langs_n;
GPtrArray *yum_argv = g_ptr_array_new_with_free_func (g_free);
pid_t child;
int clone_flags = SIGCHLD | CLONE_NEWNS | CLONE_NEWPID;
@ -327,6 +328,25 @@ yum_context_new (RpmOstreeTreeComposeContext *self,
cancellable, error))
goto out;
install_langs_n = json_object_get_member (treedata, "install-langs");
if (install_langs_n != NULL)
{
JsonArray *instlangs_a = json_node_get_array (install_langs_n);
guint len = json_array_get_length (instlangs_a);
guint i;
GString *opt = g_string_new ("--setopt=override_install_langs=");
for (i = 0; i < len; i++)
{
g_string_append (opt, json_array_get_string_element (instlangs_a, i));
if (i < len - 1)
g_string_append_c (opt, ',');
}
g_ptr_array_add (yum_argv, opt->str);
g_string_free (opt, FALSE);
}
g_ptr_array_add (yum_argv, g_strconcat ("--installroot=",
gs_file_get_path_cached (yumroot),
NULL));