From d08cadfb28daad3cc5560d2aaf0815aaeb5bf21a Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Fri, 31 Aug 2012 21:26:40 +0200 Subject: ephy-profile-migrator: add a "requested version" option to the migrator This will allow us to catch mismatches between browser and migrator binary. --- lib/ephy-profile-migrator.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') 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 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)) { -- cgit v1.2.3