diff options
author | Fabiano FidĂȘncio <fabiano@fidencio.org> | 2012-08-16 15:54:11 -0300 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2012-08-23 15:18:50 +0100 |
commit | 12e13186165f9f6ecb5e1eb92fea450502bb81c2 (patch) | |
tree | c16550f2a86193aba45af568cecfaea1cea335cf /tools | |
parent | 1d9822aeee73a868e1df6c6a2b06a5542f2e607a (diff) | |
download | libosinfo-12e13186165f9f6ecb5e1eb92fea450502bb81c2.tar.gz |
Add desktop profile for Windows
To create an user and set their avatar, we need to create 2 new files,
that will be used in older Windows.
(http://bugzilla-attachments.gnome.org/attachment.cgi?id=214681)
Was discussed in the ML about don't create this files and put all
information in only one script, separating each file in one template, as
suggested in:
https://www.redhat.com/archives/virt-tools-list/2012-June/msg00078.html
In the implementation time, a limitation occurred, and I realized that
I was doing the things in the wrong way. (if there is 1 script for all
the files and _generate*() gives you 1 file as output, how we could
generate different files from the unique file?) So, I would like to go
back with the first implementation, creating different files for each
file used by windows xp (e. g.)
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/osinfo-install-script.c | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/tools/osinfo-install-script.c b/tools/osinfo-install-script.c index 8631f12..52acee2 100644 --- a/tools/osinfo-install-script.c +++ b/tools/osinfo-install-script.c @@ -111,10 +111,9 @@ static gboolean generate_script(OsinfoOs *os) OsinfoInstallScriptList *scripts = osinfo_os_get_install_script_list(os); OsinfoInstallScriptList *profile_scripts; OsinfoFilter *filter; - OsinfoInstallScript *script; + GList *l, *tmp; gboolean ret = FALSE; GError *error = NULL; - GFile *dir = g_file_new_for_commandline_arg(output_dir ? output_dir : "."); filter = osinfo_filter_new(); osinfo_filter_add_constraint(filter, @@ -123,35 +122,31 @@ static gboolean generate_script(OsinfoOs *os) OSINFO_INSTALL_SCRIPT_PROFILE_JEOS); profile_scripts = osinfo_install_scriptlist_new_filtered(scripts, filter); - - if (osinfo_list_get_length(OSINFO_LIST(profile_scripts)) != 1) { - g_printerr("Cannot find any install script for profile '%s'\n", - profile ? profile : - OSINFO_INSTALL_SCRIPT_PROFILE_JEOS); - goto cleanup; - } - - script = OSINFO_INSTALL_SCRIPT(osinfo_list_get_nth(OSINFO_LIST(profile_scripts), 0)); - - if (prefix) - osinfo_install_script_set_output_prefix(script, prefix); - - osinfo_install_script_generate_output(script, - os, - config, - dir, - NULL, - &error); - - if (error != NULL) { - g_printerr("Unable to generate install script: %s\n", - error->message ? error->message : "unknown"); - goto cleanup; + l = osinfo_list_get_elements(OSINFO_LIST(profile_scripts)); + for (tmp = l; tmp != NULL; tmp = tmp->next) { + OsinfoInstallScript *script = tmp->data; + GFile *dir = g_file_new_for_commandline_arg(output_dir ? + output_dir : "."); + + if (prefix) + osinfo_install_script_set_output_prefix(script, prefix); + + osinfo_install_script_generate_output(script, + os, + config, + dir, + NULL, + &error); + if (error != NULL) { + g_printerr("Unable to generate install script: %s\n", + error->message ? error->message : "unknown"); + goto cleanup; + } } - ret = TRUE; cleanup: + g_list_free(l); g_object_unref(scripts); g_object_unref(filter); g_object_unref(profile_scripts); |