[gnome-software/wip/hughsie/flatpak] trivial: Don't log a critical warning when /usr/lib/os-release does not exist



commit 5e57de50d82fce44e270fd93a3745783b5cfac4b
Author: Richard Hughes <richard hughsie com>
Date:   Fri Jul 22 15:05:12 2016 +0100

    trivial: Don't log a critical warning when /usr/lib/os-release does not exist

 src/plugins/gs-plugin-odrs.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/gs-plugin-odrs.c b/src/plugins/gs-plugin-odrs.c
index 9c67bc6..8e508fd 100644
--- a/src/plugins/gs-plugin-odrs.c
+++ b/src/plugins/gs-plugin-odrs.c
@@ -63,15 +63,16 @@ gs_plugin_initialize (GsPlugin *plugin)
 
        /* get the distro name (e.g. 'Fedora') but allow a fallback */
        os_release = gs_os_release_new (&error);
-       if (os_release == NULL) {
+       if (os_release != NULL) {
+               priv->distro = g_strdup (gs_os_release_get_name (os_release));
+               if (priv->distro == NULL) {
+                       g_warning ("no distro name specified");
+                       priv->distro = g_strdup ("Unknown");
+               }
+       } else {
                g_warning ("failed to get distro name: %s", error->message);
                priv->distro = g_strdup ("Unknown");
        }
-       priv->distro = g_strdup (gs_os_release_get_name (os_release));
-       if (priv->distro == NULL) {
-               g_warning ("failed to get distro name");
-               priv->distro = g_strdup ("Unknown");
-       }
 
        /* need application IDs and version */
        gs_plugin_add_rule (plugin, GS_PLUGIN_RULE_RUN_AFTER, "appstream");


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