From bf2cfa77a1003319b4c0b768f724d1481ec866aa Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 3 Jun 2014 18:39:12 +0200 Subject: Remove unnecessary sub-directory --- test/windows/unpack | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100755 test/windows/unpack (limited to 'test/windows/unpack') 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 -- cgit v1.1