[gnome-shell] extensions-tool: Handle existing extension folder



commit 9d5c743a98e8c1dadafd2a3a22b5ac9a08e8b435
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jan 11 23:35:12 2019 +0100

    extensions-tool: Handle existing extension folder
    
    g_file_make_directory_with_parents() returns an error if the directory
    already exists (unlike g_mkdir_with_parents()), so it is currently
    impossible to install more than a single extension, whoops.
    
    Handle the error properly by just carrying on.
    
    https://gitlab.gnome.org/fmuellner/gnome-extensions-tool/merge_requests/3
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/1234

 src/extensions-tool/command-install.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/extensions-tool/command-install.c b/src/extensions-tool/command-install.c
index 58f62bb866..501f9502c8 100644
--- a/src/extensions-tool/command-install.c
+++ b/src/extensions-tool/command-install.c
@@ -121,7 +121,12 @@ install_extension (const char *bundle,
                                       "gnome-shell", "extensions", NULL);
 
   if (!g_file_make_directory_with_parents (dstdir, NULL, &error))
-    goto err;
+    {
+      if (error->code == G_IO_ERROR_EXISTS)
+        g_clear_error (&error);
+      else
+        goto err;
+    }
 
   uuid = json_object_get_string_member (metadata, "uuid");
   dst = g_file_get_child (dstdir, uuid);


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