60_buildsupport.sh 747 Bytes
Newer Older
Thanassis Tsiodras's avatar
Thanassis Tsiodras committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. ${DIR}/common.sh

# Setup the tools in ~/.local/bin
cd $DIR/../buildsupport || exit 1

# Skip Ocarina building if tree is clean and version is identical
HEAD="$(git log --oneline | head -1 | cut -d' ' -f1)"
VERSION_INSTALLED="$(buildsupport -v 2>&1 | grep -A1 Based | tail -1 | tr -d '\012')"
git status >/dev/null
TREE_CLEAN=$?
if [ ${TREE_CLEAN} -eq 0 -a "${HEAD}" == "${VERSION_INSTALLED}" ] ; then
    echo Buildsupport tree is clean and already installed. Skipping Buildsupport build...
    exit 0
fi

make clean # ignore any errors here
make || exit 1
cp buildsupport ${PREFIX}/bin || exit 1

# Add Ocarina to PATH
PATH_CMD='export PATH=$PATH:'"${PREFIX}/bin"
UpdatePATH