create caps_cache if it doesn't exists (can happen if logs.db is created in 0.11.2 version). fixes #3512

This commit is contained in:
Yann Leboulanger 2007-10-23 15:16:39 +00:00
parent 7ab8aa4710
commit 97f4c470b5
3 changed files with 28 additions and 2 deletions

View File

@ -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)

View File

@ -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'):

View File

@ -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')