summaryrefslogtreecommitdiff
path: root/test/windows/unpack
blob: bf8477aab89bb93bd20f7afc01b277ea161a0a55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#! /usr/bin/env bash

# Unpack libstudxml for Windows.
#
# -mingw  unpack for MinGW
#

trap 'exit 1' ERR

function error ()
{
  echo "$*" 1>&2
}

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/libstudxml
else
  base=/cygdrive/t/libstudxml
fi

rm -rf libstudxml libstudxml-*

v=`echo $base/libstudxml-*.*.*.zip | sed -e "s%$base/libstudxml-\([^-]*\).*.zip%\1%"`

echo unpacking libstudxml-$v from $base

unzip -q $base/libstudxml-$v.zip
mv libstudxml-$v libstudxml