[epiphany/mcatanzaro/webapp-profile: 9/23] profile-migrator: Fix migrators maybe not running for default profile



commit 8f8319f3a9610e2633cbfbcdcb9c38718c3de83b
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sat Mar 16 12:40:39 2019 -0500

    profile-migrator: Fix migrators maybe not running for default profile
    
    Problem is, Epiphany creates the new profile dir with current migration
    version if it does not exist on startup, BEFORE running the migrator. So
    all migrators are guaranteed to never run if ~/.local/share/epiphany
    does not exist. This makes testing migration really hard.
    
    Still, this would probably not be a problem for most users, since they
    will have local storage and databases stored here already.

 src/profile-migrator/ephy-profile-migrator.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index 5778e2b2d..00d6d3927 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -1305,8 +1305,10 @@ ephy_migrator (void)
     return TRUE;
   }
 
-  latest = MAX (ephy_profile_utils_get_migration_version (),
-                ephy_profile_utils_get_migration_version_for_profile_dir (legacy_profile_dir ()));
+  if (g_file_test (legacy_profile_dir (), G_FILE_TEST_EXISTS))
+    latest = ephy_profile_utils_get_migration_version_for_profile_dir (legacy_profile_dir ());
+  else
+    latest = ephy_profile_utils_get_migration_version ();
 
   LOG ("Running migrators up to version %d, current migration version is %d.",
        EPHY_PROFILE_MIGRATION_VERSION, latest);


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