[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] [PATCH 09/10] Change osinfo_install_script_generate to write the output in a file



On Mon, Jun 11, 2012 at 11:23:10PM -0300, Fabiano Fidêncio wrote:
>     For libosinfo API:
>         Now, instead of return a string, writes that string in a file,
>         passed as argument
> 
>     For osinfo-install-script tool:
>         The output will be wrote in:
>             - Linuxes: <short_id>,ks
>             - Windows 2k3r2 and older: windows.sif
>             - Windows 2k8 and newer: windows.xml
> 
>     It will be used to create, easily, multiple scripts, as used in:
>     http://bugzilla-attachments.gnome.org/attachment.cgi?id=214681

I was a bit dubious about this one at first, but seeing what you
needed to do with the windows scripts, I understand now.

If we follow my suggestion, of actually putting the required
filename in the XML metadata, this API will need to change
slightly too.

> +gboolean osinfo_install_script_generate(OsinfoInstallScript *script,
> +                                        OsinfoOs *os,
> +                                        OsinfoInstallConfig *config,
> +                                        gchar *path,
> +                                        GCancellable *cancellable,
> +                                        GError **error);


I'd suggest it should take a 'GFile *outputdir' parameter,
and then for each template filename listed in the XML,
we generate  'outputdir/filename'.  Using GFile is preferrable
to gchar *path, since then we're not tied to local paths - apps
can use any URI scheme supported by GIO.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]