[gnome-software] odrs: Remove any epoch before sending the version number



commit 3bdf220ee8a4551a330b35c02f521e45e479f50b
Author: Richard Hughes <richard hughsie com>
Date:   Wed Jul 13 13:06:31 2016 +0100

    odrs: Remove any epoch before sending the version number

 src/plugins/gs-plugin-odrs.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/gs-plugin-odrs.c b/src/plugins/gs-plugin-odrs.c
index 362a64a..18efe0d 100644
--- a/src/plugins/gs-plugin-odrs.c
+++ b/src/plugins/gs-plugin-odrs.c
@@ -667,9 +667,20 @@ gs_plugin_refine_app (GsPlugin *plugin,
 static gchar *
 gs_plugin_odrs_sanitize_version (const gchar *version)
 {
-       gchar *tmp = g_strdup (version);
-       if (tmp == NULL)
+       gchar *str;
+       gchar *tmp;
+
+       /* nothing set */
+       if (version == NULL)
                return g_strdup ("unknown");
+
+       /* remove epoch */
+       str = g_strrstr (version, ":");
+       if (str != NULL)
+               version = str + 1;
+
+       /* remove release */
+       tmp = g_strdup (version);
        g_strdelimit (tmp, "-", '\0');
        return tmp;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]