ia64/xen-unstable

view tools/check/chk @ 2895:0d70a2747177

bitkeeper revision 1.1159.165.1 (418aa0f4koam0mhscMMP2HGuqLK5kQ)

install.sh now does a few checks to warn the user if prerequisite tools are missing.
author iap10@labyrinth.cl.cam.ac.uk
date Thu Nov 04 21:36:52 2004 +0000 (2004-11-04)
parents 9afec5bc14ae
children 622f60f46a5a
line source
1 #!/bin/bash
3 function usage {
4 echo "Usage:"
5 echo "\t$0 [build|install|clean]"
6 echo
7 echo "Check suitability for Xen build or install."
8 echo "Exit with 0 if OK, 1 if not."
9 echo "Prints only failed tests."
10 echo
11 echo "Calling with 'clean' removes generated files."
12 exit 1
13 }
15 export PATH=${PATH}:/sbin:/usr/sbin
17 case $1 in
18 build)
19 check="CHECK-BUILD"
20 info=".chkbuild"
21 ;;
22 install)
23 check="CHECK-INSTALL"
24 info=".chkinstall"
25 ;;
26 clean)
27 rm -f .chkbuild .chkinstall
28 exit 0
29 ;;
30 *)
31 usage
32 ;;
33 esac
35 failed=0
37 echo "Xen ${check} " $(date) > ${info}
38 for f in check_* ; do
39 case $f in
40 *~)
41 continue
42 ;;
43 *)
44 ;;
45 esac
46 if ! [ -x $f ] ; then
47 continue
48 fi
49 if ! grep -q ${check} $f ; then
50 continue
51 fi
52 echo ' ' >> ${info}
53 echo "Checking $f" >> ${info}
54 if ./$f 1>>${info} 2>&1 ; then
55 echo OK >> ${info}
56 else
57 failed=1
58 echo "FAILED $f"
59 echo FAILED >> ${info}
60 fi
61 done
63 echo >> ${info}
65 if [ "$failed" == "1" ] ; then
66 echo "Checks failed. See `pwd`/${info} for details."
67 echo "FAILED" >> ${info}
68 exit 1
69 else
70 echo "OK" >> ${info}
71 exit 0
72 fi