turns printfs back on
[freebsd-src/fkvm-freebsd.git] / tools / regression / atm / Funcs.sh
blobc981f101df9447933ffdc17130d08d762054e421
1 #!/bin/sh
2 # $FreeBSD$
4 fatal() {
5 echo -e "$*" >&2
6 exit 1
9 msg() {
10 echo -e "$*" >&2
13 usage1() {
14 msg "Usage: RunTest.sh [-hq] [-b <localbase>]"
15 msg "Options:"
16 msg " -h show this info"
17 msg " -b <localbase> localbase if not /usr/local"
18 msg " -q be quite"
19 msg " -u run user space test, not kernel"
20 exit 0
23 parse_options() {
24 args=`getopt b:hqu $*`
25 if [ $? -ne 0 ] ; then
26 fatal "Usage: $0 [-qu] [-b <localbase>]"
29 options=""
30 set -- $args
31 for i
33 case "$i"
36 -h) usage1;;
37 -u|-q) options="$options $i"; shift;;
38 -b) LOCALBASE="$2"; shift; shift;;
39 --) shift; break;;
40 esac
41 done
43 if [ "$LOCALBASE" = "" ] ; then
44 LOCALBASE="/usr/local"
46 pkg_info -I atmsupport-\* 2>/dev/null >/dev/null
47 if [ $? -ne 0 ] ; then
48 fatal "Atmsupport package not installed. \
49 Goto /usr/ports/net/atmsupport,\ntype 'make ; make install ; make clean' \
50 and re-run this script"