[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819

Daniele Ricci daniele.athome at gmail.com
Sat Aug 6 08:20:09 UTC 2011


The following commit has been merged in the debian branch:
commit 8a42b27259cfb34e6fd0fd6f88980b3914dda25c
Author: Daniele Ricci <daniele.athome at gmail.com>
Date:   Tue Oct 19 00:52:22 2010 +0200

    Db upgrader skeleton
    
    Signed-off-by: Daniele Ricci <daniele.athome at gmail.com>

diff --git a/framework/subsystems/opimd/db_handler.py b/framework/subsystems/opimd/db_handler.py
index 8518f4a..9af432b 100644
--- a/framework/subsystems/opimd/db_handler.py
+++ b/framework/subsystems/opimd/db_handler.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 #
 #   Openmoko PIM Daemon
-#   SQLite-Contacts Backend Plugin
+#   SQLite Backend Plugin
 #
 #   http://openmoko.org/
 #
@@ -24,7 +24,7 @@
 #   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 
-"""opimd SQLite-Contacts Backend Plugin"""
+"""opimd SQLite Backend Plugin"""
 import os
 import sqlite3
 
diff --git a/framework/subsystems/opimd/db_upgrade.py b/framework/subsystems/opimd/db_upgrade.py
new file mode 100644
index 0000000..412ad96
--- /dev/null
+++ b/framework/subsystems/opimd/db_upgrade.py
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+#
+#   Openmoko PIM Daemon
+#   SQLite database upgrade
+#
+#   http://openmoko.org/
+#
+#   Copyright (C) 2009 by Thomas "Heinervdm" Zimmermann (zimmermann at vdm-design.de)
+#                         Sebastian dos Krzyszkowiak (seba.dos1 at gmail.com)
+#                         Tom "TAsn" Hacohen (tom at stosb.com)
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+"""
+ opimd SQLite database upgrade
+
+ database versions:
+ 1.0 - old table schema
+ 2.0 - new table schema
+ 2.1 - MessageSent and MessageRead changed to use only New for both
+"""
+
+import os
+import sqlite3
+
+import logging
+logger = logging.getLogger('opimd')
+
+import framework.patterns.tasklet as tasklet
+from framework.config import config, rootdir
+
+DB_VERSIONS = (
+    "1.0",
+    "2.0",
+    "2.1"
+)
+
+DB_OK=0             # database is ok
+DB_NEEDS_UPGRADE=1  # database needs upgrade
+DB_UNSUPPORTED=2    # database version not supported (too new)
+
+def check_version(conn, cur):
+    return DB_NEEDS_UPGRADE

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list