aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ephy-profile-migrator.c10
-rw-r--r--lib/ephy-profile-utils.c8
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c
index 0f4d49938..9acafd7e2 100644
--- a/lib/ephy-profile-migrator.c
+++ b/lib/ephy-profile-migrator.c
@@ -53,6 +53,7 @@
static int do_step_n = -1;
static int version = -1;
+static char *profile_dir = NULL;
/*
* What to do to add new migration steps:
@@ -889,6 +890,8 @@ static const GOptionEntry option_entries[] =
N_("Executes only the n-th migration step"), NULL },
{ "version", 'v', 0, G_OPTION_ARG_INT, &version,
N_("Specifies the required version for the migrator"), NULL },
+ { "profile-dir", 'p', 0, G_OPTION_ARG_FILENAME, &profile_dir,
+ N_("Specifies the profile where the migrator should run"), NULL },
{ NULL }
};
@@ -898,6 +901,7 @@ main (int argc, char *argv[])
GOptionContext *option_context;
GOptionGroup *option_group;
GError *error = NULL;
+ EphyFileHelpersFlags file_helpers_flags = EPHY_FILE_HELPERS_NONE;
g_type_init ();
@@ -930,7 +934,11 @@ main (int argc, char *argv[])
ephy_debug_init ();
- if (!ephy_file_helpers_init (NULL, EPHY_FILE_HELPERS_NONE, NULL)) {
+ if (profile_dir != NULL)
+ file_helpers_flags = EPHY_FILE_HELPERS_PRIVATE_PROFILE |
+ EPHY_FILE_HELPERS_KEEP_DIR;
+
+ if (!ephy_file_helpers_init (profile_dir, file_helpers_flags, NULL)) {
LOG ("Something wrong happened with ephy_file_helpers_init()");
return -1;
}
diff --git a/lib/ephy-profile-utils.c b/lib/ephy-profile-utils.c
index 829d68925..58abfff61 100644
--- a/lib/ephy-profile-utils.c
+++ b/lib/ephy-profile-utils.c
@@ -51,6 +51,14 @@ ephy_profile_utils_get_migration_version ()
if (result != 1)
latest = 0;
+ } else if (ephy_dot_dir_is_default () == FALSE) {
+ /* Since version 8, we need to migrate also profile directories
+ other than the default one. Profiles in such directories work
+ perfectly fine without going through the first 7 migration
+ steps, so it is safe to assume that any non-default profile
+ directory without a migration file can be migrated starting
+ from the step 8. */
+ latest = 7;
}
g_free (migrated_file);