[Libosinfo] [PATCH 2/5] Add an optional 'is-continuous-snapshot' tag to OS entries
Zeeshan Ali (Khattak)
zeeshanak at gnome.org
Thu Nov 21 17:52:54 UTC 2013
Applications can use this to determine if an OS is just a snapshot and
not an actual released product yet. For example, gnome-continuous images
for development snapshots of GNOME and nightly build ISOs of Fedora etc.
---
data/schemas/libosinfo.rng | 5 +++++
osinfo/libosinfo.syms | 1 +
osinfo/osinfo_loader.c | 1 +
osinfo/osinfo_os.c | 18 ++++++++++++++++++
osinfo/osinfo_os.h | 8 +++++---
5 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/data/schemas/libosinfo.rng b/data/schemas/libosinfo.rng
index 786fc3a..6187cab 100644
--- a/data/schemas/libosinfo.rng
+++ b/data/schemas/libosinfo.rng
@@ -486,6 +486,11 @@
<ref name='bool'/>
</element>
</optional>
+ <optional>
+ <element name='is-continuous-snapshot'>
+ <ref name='bool'/>
+ </element>
+ </optional>
<zeroOrMore>
<ref name='resources'/>
</zeroOrMore>
diff --git a/osinfo/libosinfo.syms b/osinfo/libosinfo.syms
index 5d620aa..c4f4b74 100644
--- a/osinfo/libosinfo.syms
+++ b/osinfo/libosinfo.syms
@@ -446,6 +446,7 @@ LIBOSINFO_0.2.8 {
LIBOSINFO_0.2.9 {
osinfo_os_get_is_pre_release;
+ osinfo_os_get_is_continuous_snapshot;
} LIBOSINFO_0.2.8;
/* Symbols in next release...
diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 1b0dad2..8e92841 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -1167,6 +1167,7 @@ static void osinfo_loader_os(OsinfoLoader *loader,
{ OSINFO_OS_PROP_FAMILY, G_TYPE_STRING },
{ OSINFO_OS_PROP_DISTRO, G_TYPE_STRING },
{ OSINFO_OS_PROP_IS_PRE_RELEASE, G_TYPE_BOOLEAN },
+ { OSINFO_OS_PROP_IS_CONTINUOUS_SNAPSHOT, G_TYPE_BOOLEAN },
{ NULL, G_TYPE_INVALID }
};
diff --git a/osinfo/osinfo_os.c b/osinfo/osinfo_os.c
index fe0bacd..6ac589f 100644
--- a/osinfo/osinfo_os.c
+++ b/osinfo/osinfo_os.c
@@ -419,6 +419,24 @@ gboolean osinfo_os_get_is_pre_release(OsinfoOs *os)
}
/**
+ * osinfo_os_get_is_continuous_snapshot:
+ * @os: an #OsinfoOs
+ *
+ * Use this to determine if @os is just a continuous integration snapshot and
+ * not an actual released product yet. For example, gnome-continuous images
+ * for development snapshots of GNOME and nightly build ISOs of Fedora etc.
+ *
+ * Returns: (transfer none): %TRUE if @os is a snapshot, %FALSE otherwise.
+ */
+gboolean osinfo_os_get_is_continuous_snapshot(OsinfoOs *os)
+{
+ g_return_val_if_fail(OSINFO_IS_OS(os), FALSE);
+
+ return osinfo_entity_get_param_value_boolean(OSINFO_ENTITY(os),
+ "is-continuous-snapshot");
+}
+
+/**
* osinfo_os_get_media_list:
* @os: an operating system
*
diff --git a/osinfo/osinfo_os.h b/osinfo/osinfo_os.h
index a7531f7..a5c2e00 100644
--- a/osinfo/osinfo_os.h
+++ b/osinfo/osinfo_os.h
@@ -55,9 +55,10 @@ typedef struct _OsinfoOsClass OsinfoOsClass;
typedef struct _OsinfoOsPrivate OsinfoOsPrivate;
-#define OSINFO_OS_PROP_FAMILY "family"
-#define OSINFO_OS_PROP_DISTRO "distro"
-#define OSINFO_OS_PROP_IS_PRE_RELEASE "is-pre-release"
+#define OSINFO_OS_PROP_FAMILY "family"
+#define OSINFO_OS_PROP_DISTRO "distro"
+#define OSINFO_OS_PROP_IS_PRE_RELEASE "is-pre-release"
+#define OSINFO_OS_PROP_IS_CONTINUOUS_SNAPSHOT "is-continuous-snapshot"
/* object */
struct _OsinfoOs
@@ -95,6 +96,7 @@ OsinfoDeviceLink *osinfo_os_add_device(OsinfoOs *os, OsinfoDevice *dev);
const gchar *osinfo_os_get_family(OsinfoOs *os);
const gchar *osinfo_os_get_distro(OsinfoOs *os);
gboolean osinfo_os_get_is_pre_release(OsinfoOs *os);
+gboolean osinfo_os_get_is_continuous_snapshot(OsinfoOs *os);
OsinfoMediaList *osinfo_os_get_media_list(OsinfoOs *os);
void osinfo_os_add_media(OsinfoOs *os, OsinfoMedia *media);
OsinfoTreeList *osinfo_os_get_tree_list(OsinfoOs *os);
--
1.8.4.2
More information about the Libosinfo
mailing list