diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-09-03 22:33:47 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-09-04 02:37:15 +0800 |
commit | 1afb0171665b4234ceb57f073a0834b6dc3e005d (patch) | |
tree | 75f16b2d1f9320a4c1aae49c6d5dff026d3a05ff /lib/ephy-profile-migrator.c | |
parent | 55ffe5b0442e58a42a5812c749359a3f22a489d1 (diff) | |
download | gsoc2013-epiphany-1afb0171665b4234ceb57f073a0834b6dc3e005d.tar gsoc2013-epiphany-1afb0171665b4234ceb57f073a0834b6dc3e005d.tar.gz gsoc2013-epiphany-1afb0171665b4234ceb57f073a0834b6dc3e005d.tar.bz2 gsoc2013-epiphany-1afb0171665b4234ceb57f073a0834b6dc3e005d.tar.lz gsoc2013-epiphany-1afb0171665b4234ceb57f073a0834b6dc3e005d.tar.xz gsoc2013-epiphany-1afb0171665b4234ceb57f073a0834b6dc3e005d.tar.zst gsoc2013-epiphany-1afb0171665b4234ceb57f073a0834b6dc3e005d.zip |
ephy-profile-migrator: allow running migration in non-default profile directories
This is necessary since we add new columns to the history database in
step 8 of migration. However, non-default profile directories don't
have a .migrated file right now but, since up to step 7 it was
possible to use these profiles without migration, it is safe to assume
that a non-default profile without a .migrated file can be migrated
starting from step 8.
https://bugzilla.gnome.org/show_bug.cgi?id=681679
Diffstat (limited to 'lib/ephy-profile-migrator.c')
-rw-r--r-- | lib/ephy-profile-migrator.c | 10 |
1 files changed, 9 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; } |