48593
|
1 |
#!/usr/bin/env bash
|
|
2 |
#
|
|
3 |
# Author: Florian Haftmann
|
|
4 |
#
|
|
5 |
# DESCRIPTION: Download and unpack components from central component store
|
|
6 |
|
|
7 |
shopt -s -o errexit
|
|
8 |
shopt -s -o nounset
|
|
9 |
|
|
10 |
THIS="$(basename "$0")"
|
|
11 |
HERE="$(cd $(dirname "$0"); cd "$(pwd -P)"; pwd)"
|
|
12 |
|
|
13 |
trap 'echo "Error in ${THIS}" >&2' ERR
|
|
14 |
|
|
15 |
function fail {
|
|
16 |
echo "$1" >&2
|
|
17 |
exit 1
|
|
18 |
}
|
|
19 |
|
|
20 |
ISABELLE_HOME_USER="$(isabelle getenv -b ISABELLE_HOME_USER)"
|
|
21 |
: ${TMP:='/tmp'}
|
|
22 |
REMOTE='http://isabelle.in.tum.de/components'
|
|
23 |
LOCAL="${ISABELLE_HOME_USER}/contrib"
|
|
24 |
SUFFIX='.tar.gz'
|
|
25 |
|
|
26 |
for COMPONENT in "$@"
|
|
27 |
do
|
|
28 |
COMPONENT_ARCHIVE="${COMPONENT}.tar.gz"
|
|
29 |
wget -nd --directory-prefix="${TMP}" "${REMOTE}/${COMPONENT_ARCHIVE}"
|
|
30 |
tar -xzv -f "${TMP}/${COMPONENT_ARCHIVE}" -C "${LOCAL}"
|
|
31 |
rm "${TMP}/${COMPONENT_ARCHIVE}"
|
|
32 |
echo
|
|
33 |
done
|