mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Clean up tools/check error reporting. Remove logging.
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
4e84295e08
commit
a5c2e9df35
7 files changed
+24
-34
No files matched your search
@@ -2,8 +2,9 @@
|
||||
# CHECK-INSTALL
|
||||
|
||||
function error {
|
||||
echo 'Check for the bridge control utils (brctl) failed.'
|
||||
echo
|
||||
echo ' *** Check for the bridge control utils (brctl) FAILED'
|
||||
exit 1
|
||||
}
|
||||
|
||||
brctl show || error
|
||||
which brctl 1>/dev/null 2>&1 || error
|
||||
@@ -2,9 +2,10 @@
|
||||
# CHECK-INSTALL
|
||||
|
||||
function error {
|
||||
echo 'Check for iproute (ip addr) failed.'
|
||||
echo
|
||||
echo ' *** Check for iproute (ip addr) FAILED'
|
||||
exit 1
|
||||
}
|
||||
|
||||
ip addr list || error
|
||||
ip addr list 1>/dev/null 2>&1 || error
|
||||
|
||||
@@ -18,11 +18,12 @@ def check_logging():
|
||||
import logging
|
||||
except ImportError:
|
||||
hline()
|
||||
msg("Python logging is not installed.")
|
||||
msg("Use 'make install-logging' at the xen root to install.")
|
||||
msg("")
|
||||
msg("Alternatively download and install from")
|
||||
msg("http://www.red-dove.com/python_logging.html")
|
||||
msg(" *** Python logging is not installed.")
|
||||
msg(" *** Use 'make install-logging' at the xen root to install.")
|
||||
msg(" *** ")
|
||||
msg(" *** Alternatively download and install from")
|
||||
msg(" *** http://www.red-dove.com/python_logging.html")
|
||||
hline()
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# CHECK-BUILD CHECK-INSTALL
|
||||
|
||||
function error {
|
||||
echo "Check for Python version 2.2 or higher failed."
|
||||
echo
|
||||
echo " *** Check for Python version >= 2.2 FAILED"
|
||||
exit 1
|
||||
}
|
||||
|
||||
python -V
|
||||
python -V 2>&1 | cut -d ' ' -f 2 | grep -q -E '^2.2|^2.3|^2.4' || error
|
||||
@@ -2,9 +2,10 @@
|
||||
# CHECK-BUILD
|
||||
|
||||
function error {
|
||||
echo 'Check for zlib includes failed.'
|
||||
echo
|
||||
echo " *** Check for zlib headers FAILED"
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -e
|
||||
[ -e /usr/include/zlib.h ] || error
|
||||
[ -e /usr/include/zlib.h ] || error
|
||||
@@ -2,9 +2,10 @@
|
||||
# CHECK-BUILD CHECK-INSTALL
|
||||
|
||||
function error {
|
||||
echo 'Check for zlib library failed.'
|
||||
echo
|
||||
echo " *** Check for zlib library FAILED"
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -e
|
||||
ldconfig -p | grep libz.so || error
|
||||
ldconfig -p | grep -q libz.so || error
|
||||
+5
-20
@@ -17,14 +17,11 @@ export PATH=${PATH}:/sbin:/usr/sbin
|
||||
case $1 in
|
||||
build)
|
||||
check="CHECK-BUILD"
|
||||
info="/tmp/xen.chkbuild"
|
||||
;;
|
||||
install)
|
||||
check="CHECK-INSTALL"
|
||||
info="/tmp/xen.chkinstall"
|
||||
;;
|
||||
clean)
|
||||
rm -f /tmp/xen.chkbuild /tmp/xen.chkinstall
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
@@ -34,7 +31,7 @@ esac
|
||||
|
||||
failed=0
|
||||
|
||||
echo "Xen ${check} " $(date) > ${info}
|
||||
echo "Xen ${check} " $(date)
|
||||
for f in check_* ; do
|
||||
case $f in
|
||||
*~)
|
||||
@@ -49,24 +46,12 @@ for f in check_* ; do
|
||||
if ! grep -q ${check} $f ; then
|
||||
continue
|
||||
fi
|
||||
echo ' ' >> ${info}
|
||||
echo "Checking $f" >> ${info}
|
||||
if ./$f 1>>${info} 2>&1 ; then
|
||||
echo OK >> ${info}
|
||||
echo -n "Checking $f: "
|
||||
if ./$f 2>&1 ; then
|
||||
echo OK
|
||||
else
|
||||
failed=1
|
||||
echo "FAILED $f"
|
||||
echo FAILED >> ${info}
|
||||
fi
|
||||
done
|
||||
|
||||
echo >> ${info}
|
||||
|
||||
if [ "$failed" == "1" ] ; then
|
||||
echo "Checks failed. See `pwd`/${info} for details."
|
||||
echo "FAILED" >> ${info}
|
||||
exit 1
|
||||
else
|
||||
echo "OK" >> ${info}
|
||||
exit 0
|
||||
fi
|
||||
exit $failed
|
||||