From 97f4c470b5e68b1d1e271dfd16b2d548e1c00a70 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 23 Oct 2007 15:16:39 +0000 Subject: [PATCH] create caps_cache if it doesn't exists (can happen if logs.db is created in 0.11.2 version). fixes #3512 --- configure.ac | 2 +- src/common/defs.py | 2 +- src/common/optparser.py | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index e79d47ba6..f859ad970 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([Gajim - A Jabber Instant Messager], - [0.11.2.1-svn],[http://trac.gajim.org/],[gajim]) + [0.11.2.2-svn],[http://trac.gajim.org/],[gajim]) AC_PREREQ([2.59]) AM_INIT_AUTOMAKE([1.8]) AC_CONFIG_HEADER(config.h) diff --git a/src/common/defs.py b/src/common/defs.py index 86ee6dce1..4516a1732 100644 --- a/src/common/defs.py +++ b/src/common/defs.py @@ -2,7 +2,7 @@ docdir = '../' datadir = '../' -version = '0.11.2.1-svn' +version = '0.11.2.2-svn' import sys, os.path for base in ('.', 'common'): diff --git a/src/common/optparser.py b/src/common/optparser.py index c6b49d0e4..4071d55bc 100644 --- a/src/common/optparser.py +++ b/src/common/optparser.py @@ -173,6 +173,8 @@ class OptionsParser: self.update_config_to_01115() if old < [0, 11, 2, 1] and new >= [0, 11, 2, 1]: self.update_config_to_01121() + if old < [0, 11, 2, 2] and new >= [0, 11, 2, 2]: + self.update_config_to_01122() gajim.logger.init_vars() gajim.config.set('version', new_version) @@ -499,3 +501,27 @@ class OptionsParser: os.remove(old_file) gajim.config.set('version', '0.11.2.1') + + def update_config_to_01122(self): + back = os.getcwd() + os.chdir(logger.LOG_DB_FOLDER) + con = sqlite.connect(logger.LOG_DB_FILE) + os.chdir(back) + cur = con.cursor() + try: + cur.executescript( + ''' + CREATE TABLE IF NOT EXISTS caps_cache ( + node TEXT, + ver TEXT, + ext TEXT, + data BLOB + ); + ''' + ) + con.commit() + except sqlite.OperationalError, e: + pass + con.close() + gajim.config.set('version', '0.11.2.2') +