ia64/xen-unstable

view tools/check/check_udev @ 13054:2732b6ab217b

Fix check_udev in the case where udev is missing -- test's -a does not shortcut.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Dec 15 09:50:33 2006 +0000 (2006-12-15)
parents afc6b5a60866
children 3b4ddf62f657
line source
1 #!/bin/sh
2 # CHECK-INSTALL
4 RC=0
6 case ${OS} in
7 OpenBSD|NetBSD|FreeBSD)
8 TOOL="vnconfig"
9 which ${TOOL} 1>/dev/null 2>&1 || RC=1
10 ;;
11 Linux)
12 TOOL="udevinfo"
13 UDEV_VERSION="0"
14 test -x "$(which ${TOOL})" && \
15 UDEV_VERSION=$(${TOOL} -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
16 if test "${UDEV_VERSION}" -ge 059; then
17 RC=0
18 else
19 TOOL="hotplug"
20 which ${TOOL} 1>/dev/null 2>&1 || RC=1
21 fi
22 ;;
23 *)
24 TOOL=""
25 echo "Unknown OS" && RC=1
26 ;;
27 esac
29 if test ${RC} -ne 0; then
30 echo
31 echo ' *** Check for ${TOOL} FAILED'
32 fi
34 exit ${RC}