Commit 36d7fa63 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras

Tremendous optimization - skip Ocarina build if Git tree is clean and already installed.

parent 900e8302
......@@ -4,6 +4,17 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Setup the tools in ~/.local/bin
cd $DIR/../ocarina || exit 1
# Skip Ocarina building if tree is clean and version is identical
HEAD="$(git log --oneline | head -1 | cut -d' ' -f1)"
VERSION_INSTALLED="$(ocarina -v 2>&1 | grep ^Oca | awk '{print $NF}' | sed 's,),,;s,r,,')"
git status >/dev/null
TREE_CLEAN=$?
if [ ${TREE_CLEAN} -eq 0 -a "${HEAD}" == "${VERSION_INSTALLED}" ] ; then
echo Ocarina tree is clean and already installed. Skipping Ocarina build...
exit 0
fi
make distclean # ignore any errors here
./support/reconfig || exit 1
./configure --prefix=${PREFIX} || exit 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment