diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2012-12-17 20:47:34 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2012-12-18 11:54:50 +0100 |
commit | b9591db34db3eea540dc28b132fb8a53885e3e05 (patch) | |
tree | e65e789b8c8f3984b72e7557766311fc06714690 | |
parent | d663f67b7ece1d5823e2e2a11f886281d5c7cb2c (diff) |
Use OS-specific config in OsinfoInstallScript
When generating the unattended installation script, we can now
use osinfo_install_config_get_param_list() to get OS-specific
values when available. This will only work when an
OsinfoInstallConfigParamList is associated with the
OsinfoInstallConfig being processed.
-rw-r--r-- | osinfo/osinfo_install_script.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c index 650e17e..e106eca 100644 --- a/osinfo/osinfo_install_script.c +++ b/osinfo/osinfo_install_script.c @@ -605,6 +605,7 @@ static xsltStylesheetPtr osinfo_install_script_load_template(const gchar *uri, static xmlNodePtr osinfo_install_script_generate_entity_config(OsinfoInstallConfig *config, OsinfoEntity *entity, + gboolean is_install_config, const gchar *name, GError **error) { @@ -636,9 +637,15 @@ static xmlNodePtr osinfo_install_script_generate_entity_config(OsinfoInstallConf tmp1 = keys = osinfo_entity_get_param_keys(entity); while (tmp1) { - GList *values = osinfo_entity_get_param_value_list(entity, tmp1->data); - GList *tmp2 = values; + GList *values; + GList *tmp2; + + if (is_install_config) + values = osinfo_install_config_get_param_value_list(OSINFO_INSTALL_CONFIG(entity), tmp1->data); + else + values = osinfo_entity_get_param_value_list(entity, tmp1->data); + tmp2 = values; while (tmp2) { if (!(data = xmlNewDocNode(NULL, NULL, (const xmlChar*)tmp1->data, (const xmlChar*)tmp2->data))) { @@ -688,6 +695,7 @@ static xmlDocPtr osinfo_install_script_generate_config_xml(OsinfoInstallScript * if (!(node = osinfo_install_script_generate_entity_config(config, OSINFO_ENTITY(script), + FALSE, "script", error))) goto error; @@ -699,6 +707,7 @@ static xmlDocPtr osinfo_install_script_generate_config_xml(OsinfoInstallScript * if (!(node = osinfo_install_script_generate_entity_config(config, OSINFO_ENTITY(os), + FALSE, "os", error))) goto error; @@ -710,6 +719,7 @@ static xmlDocPtr osinfo_install_script_generate_config_xml(OsinfoInstallScript * if (!(node = osinfo_install_script_generate_entity_config(config, OSINFO_ENTITY(config), + TRUE, "config", error))) goto error; |