summaryrefslogtreecommitdiffstats
path: root/kexi/examples/build_kexi_file.sh
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/examples/build_kexi_file.sh
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/examples/build_kexi_file.sh')
-rwxr-xr-xkexi/examples/build_kexi_file.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/kexi/examples/build_kexi_file.sh b/kexi/examples/build_kexi_file.sh
new file mode 100755
index 00000000..a3d73cd9
--- /dev/null
+++ b/kexi/examples/build_kexi_file.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# Builds a single .kexi file from a .sql file specified as $1.
+# The destination .kexi file is saved with name specified as $2.
+# $2 can be omitted if $1 is of a form "name.kexi.sql" - then
+# the destination file will be "name.kexi".
+# Only .kexi file that is older than .sql file is recreated.
+# ksqlite is needed on the $PATH.
+
+KEXISQL3PATH=../3rdparty/kexisql3/src/.libs/
+PATH=$KEXISQL3PATH:$PATH
+export PATH
+LD_LIBRARY_PATH=$KEXISQL3PATH:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH
+which ksqlite > /dev/null || exit 1
+
+[ $# -lt 1 ] && echo "Missing .sql filename." && exit 1
+
+if [ $# -lt 2 ] ; then
+ kexi_file=`echo $1 | sed -e "s/\.kexi\.sql/\.kexi/"`
+else
+ kexi_file=$2
+fi
+
+if test -f "$kexi_file" -a ! "$kexi_file" -ot "$1" ; then
+ echo "Local $kexi_file is newer than $1 - skipping it"
+ exit 0
+fi
+
+rm -f "$kexi_file"
+echo "Creating \"$kexi_file\" ... "
+ksqlite "$kexi_file" < "$1" || exit 1
+echo "OK"