[Libosinfo] [PATCH 5/7] tools: osinfo-detect prints variant
Zeeshan Ali (Khattak)
zeeshanak at gnome.org
Tue Nov 26 16:16:31 UTC 2013
If a particular variant is matched against, osinfo-detect should print
the name of that variant rather than the OS itself.
---
tools/osinfo-detect.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tools/osinfo-detect.c b/tools/osinfo-detect.c
index 0f837de..781b1e9 100644
--- a/tools/osinfo-detect.c
+++ b/tools/osinfo-detect.c
@@ -136,12 +136,20 @@ static void print_media(OsinfoMedia *media)
g_print("OSINFO_MEDIA=%s\n",
osinfo_entity_get_id(OSINFO_ENTITY(media)));
} else {
- const gchar *name = osinfo_product_get_name(OSINFO_PRODUCT(os));
+ OsinfoVariant *variant;
+ const gchar *name;
+
+ variant = osinfo_media_get_variant(media);
+ if (variant != NULL)
+ name = osinfo_variant_get_name(variant);
+ else
+ name = osinfo_product_get_name(OSINFO_PRODUCT(os));
if (osinfo_media_get_installer (media))
g_print(_("Media is an installer for OS '%s'\n"), name);
if (osinfo_media_get_live (media))
g_print(_("Media is live media for OS '%s'\n"), name);
+ g_clear_object(&variant);
}
g_object_unref(os);
}
--
1.8.4.2
More information about the Libosinfo
mailing list