tools: make gst-inspect print the release date time stamp
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 23 Jul 2010 19:46:10 +0000 (20:46 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 23 Jul 2010 19:46:10 +0000 (20:46 +0100)
tools/gst-inspect.c

index 2007aad..43d809c 100644 (file)
@@ -1162,6 +1162,25 @@ print_plugin_info (GstPlugin * plugin)
   n_print ("  Version:\t\t%s\n", plugin->desc.version);
   n_print ("  License:\t\t%s\n", plugin->desc.license);
   n_print ("  Source module:\t%s\n", plugin->desc.source);
+  if (plugin->desc.release_datetime != NULL) {
+    const gchar *tz = "(UTC)";
+    gchar *str, *sep;
+
+    /* may be: YYYY-MM-DD or YYYY-MM-DDTHH:MMZ */
+    /* YYYY-MM-DDTHH:MMZ => YYYY-MM-DD HH:MM (UTC) */
+    str = g_strdup (plugin->desc.release_datetime);
+    sep = strstr (str, "T");
+    if (sep != NULL) {
+      *sep = ' ';
+      sep = strstr (sep + 1, "Z");
+      if (sep != NULL)
+        *sep = ' ';
+    } else {
+      tz = "";
+    }
+    n_print ("  Source release date:\t%s%s\n", str, tz);
+    g_free (str);
+  }
   n_print ("  Binary package:\t%s\n", plugin->desc.package);
   n_print ("  Origin URL:\t\t%s\n", plugin->desc.origin);
   n_print ("\n");