mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-11-06 03:01:35 +01:00
Allow onos-buck to run without ONOS_ROOT
Change-Id: If1cf24eda006df5418b2d7dc73523c41c6649254
This commit is contained in:
parent
8f45ce2bb9
commit
4ed68b6943
@ -11,8 +11,10 @@ REQUIRED_VERSION="buck version 274d79c597589aeac30b39ece59fb78afda78530"
|
|||||||
|
|
||||||
[ "-U" = "$1" ] && shift && FORCE_UPDATE=True
|
[ "-U" = "$1" ] && shift && FORCE_UPDATE=True
|
||||||
|
|
||||||
mkdir -p $ONOS_ROOT/bin
|
ROOT_DIR=${ONOS_ROOT:-"$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"}
|
||||||
pushd $ONOS_ROOT/bin > /dev/null
|
|
||||||
|
mkdir -p $ROOT_DIR/bin
|
||||||
|
pushd $ROOT_DIR/bin > /dev/null
|
||||||
|
|
||||||
if [ -n "$FORCE_UPDATE" ] || [ ! -f "buck" ] || [ "$REQUIRED_VERSION" != "$(cat .buck_version)" ]; then
|
if [ -n "$FORCE_UPDATE" ] || [ ! -f "buck" ] || [ "$REQUIRED_VERSION" != "$(cat .buck_version)" ]; then
|
||||||
echo "Updating Buck..."
|
echo "Updating Buck..."
|
||||||
@ -32,12 +34,12 @@ if [ -n "$FORCE_UPDATE" ] || [ ! -f "buck" ] || [ "$REQUIRED_VERSION" != "$(cat
|
|||||||
unzip cache/$BUCK_FILE
|
unzip cache/$BUCK_FILE
|
||||||
# Kill buckd
|
# Kill buckd
|
||||||
ps -ef | egrep buckd | grep -v egrep | cut -c7-11 | xargs kill 2>/dev/null || :
|
ps -ef | egrep buckd | grep -v egrep | cut -c7-11 | xargs kill 2>/dev/null || :
|
||||||
rm -rf $ONOS_ROOT/buck-out
|
rm -rf $ROOT_DIR/buck-out
|
||||||
printf "Successfully updated Buck in $ONOS_ROOT/bin/buck to $BUCK_FILE\n\n"
|
printf "Successfully updated Buck in $ROOT_DIR/bin/buck to $BUCK_FILE\n\n"
|
||||||
fi
|
fi
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
BUCK=$ONOS_ROOT/bin/buck
|
BUCK=$ROOT_DIR/bin/buck
|
||||||
|
|
||||||
# Finally, run the Buck command...
|
# Finally, run the Buck command...
|
||||||
$BUCK "$@"
|
$BUCK "$@"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user