[epiphany/mcatanzaro/webapp-profile: 15/19] profile-migrator: Add migrator to delete bad config dirs



commit 38404a98e03b9d56a460f42824b06dbadc1e8a16
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sun Mar 17 10:38:13 2019 -0500

    profile-migrator: Add migrator to delete bad config dirs

 lib/ephy-profile-utils.h                     |  2 +-
 src/profile-migrator/ephy-profile-migrator.c | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/lib/ephy-profile-utils.h b/lib/ephy-profile-utils.h
index af1c2d472..ce77b338b 100644
--- a/lib/ephy-profile-utils.h
+++ b/lib/ephy-profile-utils.h
@@ -24,7 +24,7 @@
 
 G_BEGIN_DECLS
 
-#define EPHY_PROFILE_MIGRATION_VERSION 30
+#define EPHY_PROFILE_MIGRATION_VERSION 31
 #define EPHY_INSECURE_PASSWORDS_MIGRATION_VERSION 11
 #define EPHY_FIREFOX_SYNC_PASSWORDS_MIGRATION_VERSION 19
 #define EPHY_TARGET_ORIGIN_MIGRATION_VERSION 21
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index a1bcd5a17..95246ee1d 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -1228,6 +1228,17 @@ migrate_profile_directories (void)
   g_file_delete (gsb_journal_file, NULL, NULL);
 }
 
+static void
+migrate_web_extension_config_dir (void)
+{
+  /* Epiphany 3.32.0 web process created its config dir in the wrong place by
+   * mistake for default profile dirs. It only contains read-only data copied
+   * from dconf, so we can just delete it.
+   */
+  g_autofree char *path = g_build_filename (ephy_default_profile_dir (), "config", NULL);
+  ephy_file_delete_dir_recursively (path, NULL);
+}
+
 static void
 migrate_nothing (void)
 {
@@ -1272,6 +1283,7 @@ const EphyProfileMigrator migrators[] = {
   /* 28 */ migrate_annoyance_list,
   /* 29 */ migrate_zoom_level,
   /* 30 */ migrate_profile_directories,
+  /* 31 */ migrate_web_extension_config_dir,
 };
 
 static gboolean


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