ia64/xen-unstable

changeset 6599:95cfc001ddd1

Clean up tools/check error reporting. Remove logging.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Sep 02 09:02:13 2005 +0000 (2005-09-02)
parents 02e104bf03c0
children 8b87d43412bf
files tools/check/check_brctl tools/check/check_iproute tools/check/check_logging tools/check/check_python tools/check/check_zlib_devel tools/check/check_zlib_lib tools/check/chk
line diff
     1.1 --- a/tools/check/check_brctl	Fri Sep 02 08:06:59 2005 +0000
     1.2 +++ b/tools/check/check_brctl	Fri Sep 02 09:02:13 2005 +0000
     1.3 @@ -2,8 +2,9 @@
     1.4  # CHECK-INSTALL
     1.5  
     1.6  function error {
     1.7 -   echo 'Check for the bridge control utils (brctl) failed.'
     1.8 +   echo
     1.9 +   echo '  *** Check for the bridge control utils (brctl) FAILED'
    1.10     exit 1
    1.11  }
    1.12  
    1.13 -brctl show || error
    1.14 \ No newline at end of file
    1.15 +which brctl 1>/dev/null 2>&1 || error
     2.1 --- a/tools/check/check_iproute	Fri Sep 02 08:06:59 2005 +0000
     2.2 +++ b/tools/check/check_iproute	Fri Sep 02 09:02:13 2005 +0000
     2.3 @@ -2,9 +2,10 @@
     2.4  # CHECK-INSTALL
     2.5  
     2.6  function error {
     2.7 -   echo 'Check for iproute (ip addr) failed.'
     2.8 +   echo
     2.9 +   echo '  *** Check for iproute (ip addr) FAILED'
    2.10     exit 1
    2.11  }
    2.12  
    2.13 -ip addr list || error
    2.14 +ip addr list 1>/dev/null 2>&1 || error
    2.15  
     3.1 --- a/tools/check/check_logging	Fri Sep 02 08:06:59 2005 +0000
     3.2 +++ b/tools/check/check_logging	Fri Sep 02 09:02:13 2005 +0000
     3.3 @@ -18,11 +18,12 @@ def check_logging():
     3.4          import logging
     3.5      except ImportError:
     3.6          hline()
     3.7 -        msg("Python logging is not installed.")
     3.8 -        msg("Use 'make install-logging' at the xen root to install.")
     3.9          msg("")
    3.10 -        msg("Alternatively download and install from")
    3.11 -        msg("http://www.red-dove.com/python_logging.html")
    3.12 +        msg("  *** Python logging is not installed.")
    3.13 +        msg("  *** Use 'make install-logging' at the xen root to install.")
    3.14 +        msg("  *** ")
    3.15 +        msg("  *** Alternatively download and install from")
    3.16 +        msg("  *** http://www.red-dove.com/python_logging.html")
    3.17          hline()
    3.18          sys.exit(1)
    3.19  
     4.1 --- a/tools/check/check_python	Fri Sep 02 08:06:59 2005 +0000
     4.2 +++ b/tools/check/check_python	Fri Sep 02 09:02:13 2005 +0000
     4.3 @@ -2,9 +2,9 @@
     4.4  # CHECK-BUILD CHECK-INSTALL
     4.5  
     4.6  function error {
     4.7 -    echo "Check for Python version 2.2 or higher failed."
     4.8 +    echo
     4.9 +    echo "  *** Check for Python version >= 2.2 FAILED"
    4.10      exit 1
    4.11  }
    4.12  
    4.13 -python -V
    4.14  python -V 2>&1 | cut -d ' ' -f 2 | grep -q -E '^2.2|^2.3|^2.4' || error
     5.1 --- a/tools/check/check_zlib_devel	Fri Sep 02 08:06:59 2005 +0000
     5.2 +++ b/tools/check/check_zlib_devel	Fri Sep 02 09:02:13 2005 +0000
     5.3 @@ -2,9 +2,10 @@
     5.4  # CHECK-BUILD
     5.5  
     5.6  function error {
     5.7 -    echo 'Check for zlib includes failed.'
     5.8 +    echo
     5.9 +    echo "  *** Check for zlib headers FAILED"
    5.10      exit 1
    5.11  }
    5.12  
    5.13  set -e
    5.14 -[ -e /usr/include/zlib.h ] || error
    5.15 \ No newline at end of file
    5.16 +[ -e /usr/include/zlib.h ] || error
     6.1 --- a/tools/check/check_zlib_lib	Fri Sep 02 08:06:59 2005 +0000
     6.2 +++ b/tools/check/check_zlib_lib	Fri Sep 02 09:02:13 2005 +0000
     6.3 @@ -2,9 +2,10 @@
     6.4  # CHECK-BUILD CHECK-INSTALL
     6.5  
     6.6  function error {
     6.7 -    echo 'Check for zlib library failed.'
     6.8 +    echo
     6.9 +    echo "  *** Check for zlib library FAILED"
    6.10      exit 1
    6.11  }
    6.12  
    6.13  set -e
    6.14 -ldconfig -p | grep libz.so || error
    6.15 \ No newline at end of file
    6.16 +ldconfig -p | grep -q libz.so || error
     7.1 --- a/tools/check/chk	Fri Sep 02 08:06:59 2005 +0000
     7.2 +++ b/tools/check/chk	Fri Sep 02 09:02:13 2005 +0000
     7.3 @@ -17,14 +17,11 @@ export PATH=${PATH}:/sbin:/usr/sbin
     7.4  case $1 in
     7.5      build)
     7.6          check="CHECK-BUILD"
     7.7 -        info="/tmp/xen.chkbuild"
     7.8          ;;
     7.9      install)
    7.10          check="CHECK-INSTALL"
    7.11 -        info="/tmp/xen.chkinstall"
    7.12          ;;
    7.13      clean)
    7.14 -        rm -f /tmp/xen.chkbuild /tmp/xen.chkinstall
    7.15          exit 0
    7.16          ;;
    7.17      *)
    7.18 @@ -34,7 +31,7 @@ esac
    7.19  
    7.20  failed=0
    7.21  
    7.22 -echo "Xen ${check} " $(date) > ${info}
    7.23 +echo "Xen ${check} " $(date)
    7.24  for f in check_* ; do
    7.25      case $f in
    7.26          *~)
    7.27 @@ -49,24 +46,12 @@ for f in check_* ; do
    7.28      if ! grep -q ${check} $f ; then
    7.29          continue
    7.30      fi
    7.31 -    echo ' ' >> ${info}
    7.32 -    echo "Checking $f" >> ${info}
    7.33 -    if ./$f 1>>${info} 2>&1 ; then
    7.34 -        echo OK >> ${info}
    7.35 +    echo -n "Checking $f: "
    7.36 +    if ./$f 2>&1 ; then
    7.37 +        echo OK
    7.38      else
    7.39          failed=1
    7.40 -        echo "FAILED $f"
    7.41 -        echo FAILED >> ${info}
    7.42      fi
    7.43  done
    7.44  
    7.45 -echo >> ${info}
    7.46 -
    7.47 -if [ "$failed" == "1" ] ; then
    7.48 -    echo "Checks failed. See `pwd`/${info} for details."
    7.49 -    echo "FAILED" >> ${info}
    7.50 -    exit 1
    7.51 -else
    7.52 -    echo "OK" >> ${info}
    7.53 -    exit 0
    7.54 -fi
    7.55 +exit $failed