get_runtimes.sh 1.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#! /bin/sh
# $Id: get_runtimes.sh 7229 2010-03-01 11:17:32Z zalila $

usage () {
    cat <<EOF
       Usage: `basename $0` [runtime1 [runtime2 [...]]]

       Download the specified runtimes and place them in
       resources/runtime

       Examples: $0 pohiada
                 $0 PolyORB-HI-Ada
                 $0 po_hi_ada po_hi_c pok

       IMPORTANT: Any pre-existing runtimes will be overriden
EOF
}

if test $# -eq 0; then
    usage
    exit 1
fi

24
repository="https://github.com/OpenAADL"
25

26 27 28 29 30 31
workdir="`pwd`"
scriptdir="`dirname $0`"; cd "${scriptdir}"; scriptdir="`pwd`"
cd ${workdir}

while test $# -ne 0; do
    r="`echo $1 | tr '[A-Z]' '[a-z]'`"
32

33
    case ${r} in
34 35 36
        --root_url=*) repository=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;

        *aadlib* )
37
	    cd ${scriptdir}/../resources/runtime || exit 2
yoogx's avatar
yoogx committed
38
	    rm -rf AADLib 2>/dev/null
39
	    git clone ${repository}/AADLib.git aadlib \
40 41 42
		|| exit 2
	    ;;

43 44 45
	*po*hi*ada* )
	    cd ${scriptdir}/../resources/runtime || exit 2
	    rm -rf polyorb-hi-ada 2>/dev/null
46
	    git clone ${repository}/polyorb-hi-ada.git \
47 48 49 50 51 52
		|| exit 2
	    ;;

	*po*hi*c* )
	    cd ${scriptdir}/../resources/runtime || exit 2
	    rm -rf polyorb-hi-c 2>/dev/null
53
	    git clone ${repository}/polyorb-hi-c.git \
54 55 56 57 58 59
		|| exit 2
	    ;;

	*pok* )
	    cd ${scriptdir}/../resources/runtime || exit 2
	    rm -rf pok 2>/dev/null
60
            git clone https://github.com/pok-kernel/pok.git \
61 62 63 64 65 66 67 68 69 70 71 72
		|| exit 2
	    ;;

	* )
	    echo "Unknown runtime: '${1}'"
	    exit 2
	    ;;
    esac
    shift
done

exit 0