[gnome-software/gnome-3-22] trivial: Create the user datadir when saving pending applications



commit 2acc4401987a85b7cab4e955c0bd1821886fad16
Author: Richard Hughes <richard hughsie com>
Date:   Mon Oct 3 17:15:55 2016 +0100

    trivial: Create the user datadir when saving pending applications

 src/gs-plugin-loader.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 8005871..d75f398 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -32,6 +32,7 @@
 #include "gs-plugin.h"
 #include "gs-plugin-private.h"
 #include "gs-common.h"
+#include "gs-utils.h"
 
 #define GS_PLUGIN_LOADER_UPDATES_CHANGED_DELAY 3       /* s */
 #define GS_PLUGIN_LOADER_RELOAD_DELAY          5       /* s */
@@ -2939,6 +2940,11 @@ save_install_queue (GsPluginLoader *plugin_loader)
                                 "gnome-software",
                                 "install-queue",
                                 NULL);
+       if (!gs_mkdir_parent (file, &error)) {
+               g_warning ("failed to create dir for %s: %s",
+                          file, error->message);
+               return;
+       }
        g_debug ("saving install queue to %s", file);
        ret = g_file_set_contents (file, s->str, (gssize) s->len, &error);
        if (!ret)


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