Brian O'Connor

Adding onos-buck file and buck alias

Change-Id: I548aade4802da87707d86c192e1800eb1edeb200
#/bin/bash
# -----------------------------------------------------------------------------
# Runs the custom version of Buck required by ONOS.
# -----------------------------------------------------------------------------
set -e
BUCK_URL="https://github.com/bocon13/buck/releases/download/v2016.04.08.01/buck"
BUCK_SHA="e22b6accd43cd3e928fe8e63256ebdc8f0b24cab"
REQUIRED_VERSION="buck version ad0295088e5da2782062636ed97bd4f71c65bddd"
[ "-U" = "$1" ] && shift && FORCE_UPDATE=True
mkdir -p $ONOS_ROOT/bin
pushd $ONOS_ROOT/bin > /dev/null
if [ -n "$FORCE_UPDATE" ] || [ ! -f "buck" ] || [ "$REQUIRED_VERSION" != "$(cat .buck_version)" ]; then
echo "Downloading Buck..."
rm -f .buck_version buck
curl -o ./buck -L $BUCK_URL
if [ -n "$(which shasum)" ]; then
SHA=$(shasum ./buck | cut -d' ' -f1)
[ "$SHA" != "$BUCK_SHA" ] &&
echo "ERROR: Downloaded SHA ($SHA) does not match expected SHA ($BUCK_SHA)" &&
exit 1
else
echo "SHA cannot be verified"
fi
chmod 555 ./buck
echo $(./buck -V 2>/dev/null) > .buck_version
chmod 444 .buck_version
rm -rf ./buck_out
printf "Successfully downloaded Buck to $ONOS_ROOT/bin/buck\n\n"
fi
popd > /dev/null
# Finally, run the Buck command...
eval $ONOS_ROOT/bin/buck $*
......@@ -198,3 +198,9 @@ alias atttopo='onos-netcfg $OCI $ONOS_ROOT/tools/test/topos/attmpls-cfg.json'
# Load UK topo GEO data
alias uktopo='onos-netcfg $OCI $ONOS_ROOT/tools/test/topos/uk-cfg.json'
# Git annotated one-line log
alias gil='git log --oneline --decorate=short'
# Buck (if "buck" is not on the PATH)
[ -z "$(which buck)" ] && alias buck="onos-buck"
......