[epiphany] ephy-profile-utils: pass the required version to the migrator



commit ba80bf28b56ebcdc42e2ba75bcee7f3b838f58fe
Author: Xan Lopez <xan igalia com>
Date:   Fri Aug 31 21:44:57 2012 +0200

    ephy-profile-utils: pass the required version to the migrator
    
    This should help catch the mistake of not installing the new migrator
    when the profile version changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683134

 lib/ephy-profile-utils.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/lib/ephy-profile-utils.c b/lib/ephy-profile-utils.c
index e225c7f..ae77712 100644
--- a/lib/ephy-profile-utils.c
+++ b/lib/ephy-profile-utils.c
@@ -196,19 +196,21 @@ ephy_profile_utils_do_migration (int test_to_run, gboolean debug)
 {
   gboolean ret;
   GError *error = NULL;
-  char *index = NULL;
+  char *index = NULL, *version = NULL;
   int status;
-  char *argv[3] = { EPHY_PROFILE_MIGRATOR };
+  char *argv[5] = { EPHY_PROFILE_MIGRATOR, "-v" };
   char *envp[1] = { "EPHY_LOG_MODULES=ephy-profile" };
 
+  argv[2] = version = g_strdup_printf ("%d", EPHY_PROFILE_MIGRATION_VERSION);
+
   if (test_to_run != -1) {
     index = g_strdup_printf ("%d", test_to_run);
 
-    argv[1] = "-d";
-    argv[2] = index;
-    argv[3] = NULL;
+    argv[3] = "-d";
+    argv[4] = index;
+    argv[5] = NULL;
   } else {
-    argv[1] = NULL;
+    argv[3] = NULL;
   }
 
   if (debug)
@@ -218,6 +220,7 @@ ephy_profile_utils_do_migration (int test_to_run, gboolean debug)
                       NULL, NULL, NULL, NULL,
                       &status, &error);
   g_free (index);
+  g_free (version);
     
   if (error) {
     LOG ("Failed to run migrator: %s", error->message);



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