---------- Forwarded message ---------- From: Fabiano Fidêncio <fabiano@xxxxxxxxxxxx> Date: Sun, Jul 1, 2012 at 4:36 PM Subject: Re: [PATCH 09/10] Change osinfo_install_script_generate to write the output in a file To: "Daniel P. Berrange" <berrange@xxxxxxxxxx> On Wed, Jun 13, 2012 at 7:35 AM, Daniel P. Berrange <berrange@xxxxxxxxxx> wrote: > 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. Sorry, It is not so clear to me. How could I set/get the filename in the XML? Example: <template filename=<xsl:value-of select="config/filename"/>>? Didn't test but I think I can't do this. > >> +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. Thinking here, we really need this change? osinfo_install_script_generate can just return the string. Why? Because it is what the apps will use, commonly. If some application (as osinfo-install-scirpt tool) would write the output in the file, we could do it in their own code, adopting your suggestion. Another thing is: if we will set/get the filename we could not pass the "filename" as argument, too? > > > 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 :| -- Fabiano Fidêncio -- Fabiano Fidêncio