[Libosinfo] [libosinfo PATCH 2/5] loader: Deal with "installer-script" media attribute

Fabiano Fidêncio fidencio at redhat.com
Fri Nov 23 14:09:57 UTC 2018


Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 osinfo/osinfo_loader.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 030062b..4367121 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1078,6 +1078,8 @@ static OsinfoMedia *osinfo_loader_media(OsinfoLoader *loader,
             xmlGetProp(root, BAD_CAST OSINFO_MEDIA_PROP_INSTALLER_REBOOTS);
     xmlChar *eject_after_install =
             xmlGetProp(root, BAD_CAST OSINFO_MEDIA_PROP_EJECT_AFTER_INSTALL);
+    xmlChar *installer_script =
+            xmlGetProp(root, BAD_CAST OSINFO_MEDIA_PROP_INSTALLER_SCRIPT);
     const OsinfoEntityKey keys[] = {
         { OSINFO_MEDIA_PROP_URL, G_TYPE_STRING },
         { OSINFO_MEDIA_PROP_KERNEL, G_TYPE_STRING },
@@ -1117,6 +1119,13 @@ static OsinfoMedia *osinfo_loader_media(OsinfoLoader *loader,
         xmlFree(eject_after_install);
     }
 
+    if (installer_script) {
+        osinfo_entity_set_param(OSINFO_ENTITY(media),
+                                OSINFO_MEDIA_PROP_INSTALLER_SCRIPT,
+                                (gchar *)installer_script);
+        xmlFree(installer_script);
+    }
+
     gint nnodes = osinfo_loader_nodeset("./variant", loader, ctxt, &nodes, err);
     if (error_is_set(err)) {
         g_object_unref(media);
-- 
2.19.1




More information about the Libosinfo mailing list