Files
xen/tools/check/chk
T
Keir Fraser b7d7bde935 Make tools/check scripts cross-friendly
This patch introduces tools/check/funcs.sh with some
cross-friendly abstractions, then modifies the check_*
scripts to use them.

Signed-off-by: Aron Griffis <aron@hp.com>
2008-01-22 09:44:17 +00:00

64 lines
950 B
Bash
Executable File

#!/bin/sh
func_usage ()
{
echo "Usage:"
echo " $0 [build|install|clean]"
echo
echo "Check suitability for Xen build or install."
echo "Exit with 0 if OK, 1 if not."
echo
echo "Calling with 'clean' removes generated files."
exit 1
}
PATH=$PATH:/sbin:/usr/sbin
OS=`uname -s`
export PATH OS
if [ "$OS" = "SunOS" ]; then
exit 0
fi
case $1 in
build)
check="CHECK-BUILD"
;;
install)
check="CHECK-INSTALL"
;;
clean)
exit 0
;;
*)
func_usage
;;
esac
failed=0
echo "Xen ${check} " `date`
for f in check_* ; do
case $f in
*~)
continue
;;
*)
;;
esac
if ! [ -x $f ] ; then
continue
fi
if ! grep -Fq "$check" $f ; then
continue
fi
echo -n "Checking $f: "
if ./$f 2>&1 ; then
echo OK
else
failed=1
fi
done
exit ${failed}