summaryrefslogtreecommitdiffstats
path: root/kexi/3rdparty/kexisql3/src/ksqlite2to3
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
commit8362bf63dea22bbf6736609b0f49c152f975eb63 (patch)
tree0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kexi/3rdparty/kexisql3/src/ksqlite2to3
downloadkoffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz
koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/3rdparty/kexisql3/src/ksqlite2to3')
-rwxr-xr-xkexi/3rdparty/kexisql3/src/ksqlite2to338
1 files changed, 38 insertions, 0 deletions
diff --git a/kexi/3rdparty/kexisql3/src/ksqlite2to3 b/kexi/3rdparty/kexisql3/src/ksqlite2to3
new file mode 100755
index 00000000..faa2f459
--- /dev/null
+++ b/kexi/3rdparty/kexisql3/src/ksqlite2to3
@@ -0,0 +1,38 @@
+#!/bin/sh
+# This file is part of the KDE project
+# Copyright (C) 2004-2005 Jaroslaw Staniek <[email protected]>
+#
+# 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.
+
+# Performs migration from SQLite2 format to SQLite3 format
+# usage: ksqlite2to3 <sqlite2-db-file>
+
+if test $# -lt 1 ; then
+ echo "usage: ksqlite2to3 <sqlite2-db-file>"
+ exit 1
+fi
+
+basename=`basename $0`
+temp=`mktemp -q "$basename"-XXXXXX 2> /dev/null || date +%y%m%d%H%M2`
+dbfile=$1
+dir=`dirname $dbfile`
+
+ksqlite2 $dbfile .quit 2> /dev/null
+if test $? -ne 0 ; then
+ echo "This file is not in SQLite2 format"
+ rm -f "$dir/$temp"
+ exit 1
+fi
+
+ksqlite2 -verbose-dump $dbfile .dump | ksqlite "$dir/$temp"
+if test $? -ne 0 ; then
+ echo "Error during converting"
+ rm -f "$dir/$temp"
+ exit 2
+fi
+
+mv "$dir/$temp" $dbfile 2> /dev/null || exit 3
+