ENGINE-427: added call to quickfix and modified how versions get updated. (This was a little broken anyway - was linked only to DDL changes. ENGINE-427
authorKrista Bennett <krista@pep-project.org>
Mon, 25 Jun 2018 10:19:12 +0200
branchENGINE-427
changeset 2764819d9603d05a
parent 2763 58a956a3fd97
child 2765 a55905bf3925
ENGINE-427: added call to quickfix and modified how versions get updated. (This was a little broken anyway - was linked only to DDL changes.
src/pEpEngine.c
src/pgp_gpg.c
     1.1 --- a/src/pEpEngine.c	Mon Jun 25 09:26:49 2018 +0200
     1.2 +++ b/src/pEpEngine.c	Mon Jun 25 10:19:12 2018 +0200
     1.3 @@ -1178,9 +1178,7 @@
     1.4          if (version < atoi(_DDL_USER_VERSION)) {
     1.5              int_result = sqlite3_exec(
     1.6                  _session->db,
     1.7 -                "pragma user_version = "_DDL_USER_VERSION";\n"
     1.8 -                "insert or replace into version_info (id, version)"
     1.9 -                    "values (1, '" PEP_ENGINE_VERSION "');",
    1.10 +                "pragma user_version = "_DDL_USER_VERSION";\n",
    1.11                  NULL,
    1.12                  NULL,
    1.13                  NULL
    1.14 @@ -1459,6 +1457,17 @@
    1.15      if (status != PEP_STATUS_OK)
    1.16          goto pep_error;
    1.17  
    1.18 +    // Because of ENGINE-427 hotfix, we can only update the version here.
    1.19 +    int_result = sqlite3_exec(
    1.20 +        _session->db,
    1.21 +        "insert or replace into version_info (id, version)"
    1.22 +            "values (1, '" PEP_ENGINE_VERSION "');",
    1.23 +        NULL,
    1.24 +        NULL,
    1.25 +        NULL
    1.26 +    );
    1.27 +    assert(int_result == SQLITE_OK);
    1.28 +
    1.29      // runtime config
    1.30  
    1.31      if (very_first)
     2.1 --- a/src/pgp_gpg.c	Mon Jun 25 09:26:49 2018 +0200
     2.2 +++ b/src/pgp_gpg.c	Mon Jun 25 10:19:12 2018 +0200
     2.3 @@ -267,6 +267,18 @@
     2.4          return false;
     2.5  
     2.6      if (f != NULL) {
     2.7 +        // ENGINE-427 - quick fix here. This will be removed in a few
     2.8 +        // versions, but we need to clean up our mess.
     2.9 +        int compare_result = -1;
    2.10 +        PEP_STATUS status = compare_cached_engine_version_to_other(
    2.11 +            &compare_result, 1, 0, 440);
    2.12 +        
    2.13 +        if (status != PEP_STATUS_OK)
    2.14 +            return false;
    2.15 +            
    2.16 +        if (compare_result < 0)
    2.17 +            quickfix_config(keys, config_file_path);
    2.18 +                
    2.19          int length = stringlist_length(keys);
    2.20  
    2.21          // make sure we 1) have the same number of keys and values