diff options
author | Xan Lopez <xan@igalia.com> | 2012-09-01 03:26:40 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-09-01 03:56:13 +0800 |
commit | d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a (patch) | |
tree | bd87e2d6bbe3838cc0efac4db08d2048740b6da0 /lib/ephy-profile-migrator.c | |
parent | a915ad73f64171934f1b7381237d8593b6a12460 (diff) | |
download | gsoc2013-epiphany-d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a.tar gsoc2013-epiphany-d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a.tar.gz gsoc2013-epiphany-d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a.tar.bz2 gsoc2013-epiphany-d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a.tar.lz gsoc2013-epiphany-d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a.tar.xz gsoc2013-epiphany-d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a.tar.zst gsoc2013-epiphany-d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a.zip |
ephy-profile-migrator: add a "requested version" option to the migrator
This will allow us to catch mismatches between browser and migrator binary.
Diffstat (limited to 'lib/ephy-profile-migrator.c')
-rw-r--r-- | lib/ephy-profile-migrator.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c index 511698351..0f4d49938 100644 --- a/lib/ephy-profile-migrator.c +++ b/lib/ephy-profile-migrator.c @@ -52,6 +52,7 @@ #include <sys/types.h> static int do_step_n = -1; +static int version = -1; /* * What to do to add new migration steps: @@ -886,6 +887,8 @@ static const GOptionEntry option_entries[] = { { "do-step", 'd', 0, G_OPTION_ARG_INT, &do_step_n, 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 }, { NULL } }; @@ -919,6 +922,12 @@ main (int argc, char *argv[]) g_option_context_free (option_context); + if (version != -1 && version != EPHY_PROFILE_MIGRATION_VERSION) { + g_print ("Version mismatch, version %d requested but our version is %d\n", version, EPHY_PROFILE_MIGRATION_VERSION); + + return 1; + } + ephy_debug_init (); if (!ephy_file_helpers_init (NULL, EPHY_FILE_HELPERS_NONE, NULL)) { |