[gnome-software/gnome-3-20] odrs: Remove any epoch before sending the version number
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-20] odrs: Remove any epoch before sending the version number
- Date: Wed, 13 Jul 2016 12:42:22 +0000 (UTC)
commit d5a57c607d52893d13b4c8e64ba83b729711dcbe
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 2c26549..7b07bb3 100644
--- a/src/plugins/gs-plugin-odrs.c
+++ b/src/plugins/gs-plugin-odrs.c
@@ -692,9 +692,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]