[Libosinfo] [PATCH 03/10] Add osinfo_install_script_generate_output_for_media*()
Christophe Fergeau
cfergeau at redhat.com
Mon May 18 15:16:33 UTC 2015
On Wed, May 13, 2015 at 06:48:29PM +0100, Zeeshan Ali (Khattak) wrote:
> Add variant of osinfo_install_script_generate_for_media*() that
> generates the script into a file.
> ---
> osinfo/libosinfo.syms | 4 +
> osinfo/osinfo_install_script.c | 250 +++++++++++++++++++++++++++++++++--------
> osinfo/osinfo_install_script.h | 17 +++
> 3 files changed, 224 insertions(+), 47 deletions(-)
>
> diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
> index ba4c020..3906f89 100644
> --- a/osinfo/libosinfo.syms
> +++ b/osinfo/libosinfo.syms
> @@ -511,6 +511,10 @@ LIBOSINFO_0.2.12 {
> osinfo_install_script_generate_for_media_async;
> osinfo_install_script_generate_for_media_finish;
>
> + osinfo_install_script_generate_output_for_media;
> + osinfo_install_script_generate_output_for_media_async;
> + osinfo_install_script_generate_output_for_media_finish;
> +
> osinfo_media_get_volume_size;
> } LIBOSINFO_0.2.11;
>
> diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c
> index 95471b0..009a473 100644
> --- a/osinfo/osinfo_install_script.c
> +++ b/osinfo/osinfo_install_script.c
> @@ -1067,6 +1067,25 @@ GFile *osinfo_install_script_generate_output_finish(OsinfoInstallScript *script,
> error);
> }
>
> +/**
> + * osinfo_install_script_generate_output_for_media_finish:
> + * @script: the install script
> + * @res: a #GAsyncResult
> + * @error: The location where to store any error, or NULL
lower case 'The' would be more consistant.
> + *
> + * Returns: (transfer full): a file containing the script, or NULL on error.
> + *
> + * Since: 0.2.12
> + */
> +GFile *osinfo_install_script_generate_output_for_media_finish(OsinfoInstallScript *script,
> + GAsyncResult *res,
> + GError **error)
> +{
> + return osinfo_install_script_generate_finish_common(script,
> + res,
> + error);
> +}
> +
> struct _OsinfoInstallScriptGenerateSyncData {
> GMainLoop *loop;
> GError *error;
> @@ -1087,6 +1106,19 @@ static void osinfo_install_script_generate_output_done(GObject *src,
> g_main_loop_quit(data->loop);
> }
>
> +static void osinfo_install_script_generate_output_for_media_done(GObject *src,
> + GAsyncResult *res,
> + gpointer user_data)
> +{
> + OsinfoInstallScriptGenerateSyncData *data = user_data;
> +
> + data->file =
> + osinfo_install_script_generate_output_for_media_finish(OSINFO_INSTALL_SCRIPT(src),
> + res,
> + &data->error);
> + g_main_loop_quit(data->loop);
> +}
> +
> static void osinfo_install_script_generate_output_close_file(GObject *src,
> GAsyncResult *res,
> gpointer user_data)
> @@ -1284,28 +1316,14 @@ static void osinfo_install_script_generate_output_write_file(GObject *src,
> }
> }
>
> -/**
> - * osinfo_install_script_generate_output_async:
> - * @script: the install script
> - * @os: the os
> - * @config: the install script config
> - * @output_dir: the directory where file containing the output script
I'd write "... where the file ..." (repeated several times through that
file).
Looks good otherwise.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20150518/c634eed0/attachment.sig>
More information about the Libosinfo
mailing list