summaryrefslogtreecommitdiff
path: root/test/windows/unpack
diff options
context:
space:
mode:
Diffstat (limited to 'test/windows/unpack')
-rwxr-xr-xtest/windows/unpack102
1 files changed, 102 insertions, 0 deletions
diff --git a/test/windows/unpack b/test/windows/unpack
new file mode 100755
index 0000000..a9e0299
--- /dev/null
+++ b/test/windows/unpack
@@ -0,0 +1,102 @@
+#! /usr/bin/env bash
+
+# Unpack ODB distribution for Windows.
+#
+# -mingw unpack for MinGW
+#
+
+trap 'exit 1' ERR
+
+function error ()
+{
+ echo "$*" 1>&2
+}
+
+databases="mssql oracle pgsql sqlite mysql"
+mingw=n
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ -mingw)
+ mingw=y
+ shift
+ ;;
+ *)
+ error "unknown option: $1"
+ exit 1
+ ;;
+ esac
+done
+
+if [ $mingw = y ]; then
+ base=/t/pack
+else
+ base=/cygdrive/t/pack
+fi
+
+rm -rf libodb libodb-mssql libodb-oracle libodb-pgsql libodb-sqlite \
+libodb-mysql libodb-boost libodb-qt odb odb-tests odb-examples \
+odb-tests-* odb-examples-*
+
+v=`echo $base/odb-*-*-*.zip | sed -e "s%$base/odb-\([^-]*\).*.zip%\1%"`
+mv=`echo $v | sed -e 's%\([0-9]*\.[0-9]*\).*%\1%'`
+
+echo unpacking $mv from $base
+
+unzip -q $base/libodb-$mv.*.zip
+mv libodb-$mv.*/ libodb
+
+unzip -q $base/libodb-mssql-$mv.*.zip
+mv libodb-mssql-$mv.*/ libodb-mssql
+
+unzip -q $base/libodb-oracle-$mv.*.zip
+mv libodb-oracle-$mv.*/ libodb-oracle
+
+unzip -q $base/libodb-pgsql-$mv.*.zip
+mv libodb-pgsql-$mv.*/ libodb-pgsql
+
+unzip -q $base/libodb-sqlite-$mv.*.zip
+mv libodb-sqlite-$mv.*/ libodb-sqlite
+
+unzip -q $base/libodb-mysql-$mv.*.zip
+mv libodb-mysql-$mv.*/ libodb-mysql
+
+unzip -q $base/libodb-boost-$mv.*.zip
+mv libodb-boost-$mv.*/ libodb-boost
+
+unzip -q $base/libodb-qt-$mv.*.zip
+mv libodb-qt-$mv.*/ libodb-qt
+
+unzip -q $base/odb-tests-$mv.*.zip
+if [ $mingw = n ]; then
+ for d in $databases; do
+ cp -r odb-tests-$mv.*/ odb-tests-$d
+ done
+ rm -r odb-tests-$mv.*
+else
+ mv odb-tests-$mv.*/ odb-tests
+fi
+
+unzip -q $base/odb-examples-$mv.*.zip
+if [ $mingw = n ]; then
+ for d in $databases; do
+ cp -r odb-examples-$mv.*/ odb-examples-$d
+ done
+ rm -r odb-examples-$mv.*
+else
+ mv odb-examples-$mv.*/ odb-examples
+fi
+
+if [ $mingw = n ]; then
+ unzip -q $base/odb-$v-i686-windows.zip
+ mv odb-$v-i686-windows odb
+
+ cp default.options odb/etc/odb/
+
+ for d in $databases; do
+ cp $d.options odb-tests-$d/
+ cp $d-driver.bat odb-tests-$d/
+ cp $d.options odb-examples-$d/
+ cp $d-driver.bat odb-examples-$d/
+ done
+fi