mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Quiesce 'which' invocation, and allow expanding variables in error message. Signed-off-by: Jan Beulich <jbeulich@novell.com>
35 lines
556 B
Bash
Executable File
35 lines
556 B
Bash
Executable File
#!/bin/sh
|
|
# CHECK-INSTALL
|
|
|
|
RC=0
|
|
|
|
case ${OS} in
|
|
OpenBSD|NetBSD|FreeBSD)
|
|
TOOL="vnconfig"
|
|
which ${TOOL} 1>/dev/null 2>&1 || RC=1
|
|
;;
|
|
Linux)
|
|
TOOL="udevinfo"
|
|
UDEV_VERSION="0"
|
|
test -x "$(which ${TOOL} 2>/dev/null)" && \
|
|
UDEV_VERSION=$(${TOOL} -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
|
|
if test "${UDEV_VERSION}" -ge 059; then
|
|
RC=0
|
|
else
|
|
TOOL="hotplug"
|
|
which ${TOOL} 1>/dev/null 2>&1 || RC=1
|
|
fi
|
|
;;
|
|
*)
|
|
TOOL=""
|
|
echo "Unknown OS" && RC=1
|
|
;;
|
|
esac
|
|
|
|
if test ${RC} -ne 0; then
|
|
echo
|
|
echo " *** Check for ${TOOL} FAILED"
|
|
fi
|
|
|
|
exit ${RC}
|