1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
#! /bin/sh
#
# BTest helper for getting values for Bro-related environment variables.
base=`dirname $0`
bro_dist=`cat ${base}/../../build/CMakeCache.txt | grep BRO_DIST | cut -d = -f 2`
if [ -n "${bro_dist}" ]; then
if [ "$1" = "bropath" ]; then
${bro_dist}/build/bro-path-dev
elif [ "$1" = "bro_plugin_path" ]; then
( cd ${base}/../.. && pwd )
elif [ "$1" = "path" ]; then
echo ${bro_dist}/build/src:${bro_dist}/aux/btest:${base}/:${bro_dist}/aux/bro-cut:$PATH
else
echo "usage: `basename $0` <var>" >&2
exit 1
fi
else
# Use Bro installation for testing. In this case bro-config must be in PATH.
if ! which bro-config >/dev/null; then
echo "bro-config not found" >&2
exit 1
fi
if [ "$1" = "bropath" ]; then
bro-config --bropath
elif [ "$1" = "bro_plugin_path" ]; then
( cd ${base}/../.. && pwd )
elif [ "$1" = "path" ]; then
echo ${PATH}
else
echo "usage: `basename $0` <var>" >&2
exit 1
fi
fi
|