[Libosinfo] [PATCHv4 08/11] Use OS-specific config in OsinfoInstallScript

Christophe Fergeau cfergeau at redhat.com
Tue Dec 18 10:05:06 UTC 2012


On Tue, Dec 18, 2012 at 03:35:55AM +0200, Zeeshan Ali (Khattak) wrote:
> On Mon, Dec 17, 2012 at 11:07 PM, Christophe Fergeau
> <cfergeau at redhat.com> wrote:
> > 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.
> > ---
> >  osinfo/osinfo_install_script.c | 15 +++++++++++++--
> >  1 file changed, 13 insertions(+), 2 deletions(-)
> >
> > diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c
> > index d72c394..8dbef9e 100644
> > --- a/osinfo/osinfo_install_script.c
> > +++ b/osinfo/osinfo_install_script.c
> > @@ -30,6 +30,7 @@
> >  #include <libxslt/xsltutils.h>
> >  #include <libxslt/xsltInternals.h>
> >  #include <glib/gi18n-lib.h>
> > +#include "osinfo_install_config_private.h"
> >  #include "osinfo_install_script_private.h"
> >
> >  G_DEFINE_TYPE (OsinfoInstallScript, osinfo_install_script, OSINFO_TYPE_ENTITY);
> > @@ -604,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)
> 
> We don't need a boolean parameter for finding out the type of entity.
> :) There is OSINFO_IS_INSTALL_CONFIG() or you can check if
> name=="config".

Yup, I've thought of both, we can also do if (config == entity) {}, but I
preferred to go the explicit way since the caller knows what it wants us to
do.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20121218/9ba07caa/attachment.sig>


More information about the Libosinfo mailing list