[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [TOOLS] Fix check-script compatibility with non-bash shells.
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxx # Node ID afc6b5a60866d79d86af934515cf13f847acf6fc # Parent 7b6aba313aac0b32f16f4c0cac768762cf246ed5 [TOOLS] Fix check-script compatibility with non-bash shells. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- tools/check/check_crypto_lib | 17 ++++++++++------- tools/check/check_openssl_devel | 17 ++++++++++------- tools/check/check_python_devel | 13 +++++++++++-- tools/check/check_udev | 39 ++++++++++++++++++++++++++++----------- tools/check/check_x11_devel | 18 +++++++++++------- 5 files changed, 70 insertions(+), 34 deletions(-) diff -r 7b6aba313aac -r afc6b5a60866 tools/check/check_crypto_lib --- a/tools/check/check_crypto_lib Thu Dec 14 15:43:40 2006 +0000 +++ b/tools/check/check_crypto_lib Thu Dec 14 16:00:31 2006 +0000 @@ -1,11 +1,14 @@ -#!/bin/bash +#!/bin/sh # CHECK-BUILD CHECK-INSTALL -function error { - echo - echo " *** Check for crypto library FAILED" - exit 1 -} +RC=0 set -e -ldconfig -p | grep -q libcrypto.so || error +ldconfig -v 2>&1 | grep -q libcrypto.so || RC=1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for crypto library FAILED" +fi + +exit ${RC} diff -r 7b6aba313aac -r afc6b5a60866 tools/check/check_openssl_devel --- a/tools/check/check_openssl_devel Thu Dec 14 15:43:40 2006 +0000 +++ b/tools/check/check_openssl_devel Thu Dec 14 16:00:31 2006 +0000 @@ -1,11 +1,14 @@ -#!/bin/bash +#!/bin/sh # CHECK-BUILD -function error { - echo - echo " *** Check for openssl headers FAILED" - exit 1 -} +RC=0 set -e -[ -e /usr/include/openssl/md5.h ] || error +test -r /usr/include/openssl/md5.h || RC=1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for openssl headers FAILED" +fi + +exit ${RC} diff -r 7b6aba313aac -r afc6b5a60866 tools/check/check_python_devel --- a/tools/check/check_python_devel Thu Dec 14 15:43:40 2006 +0000 +++ b/tools/check/check_python_devel Thu Dec 14 16:00:31 2006 +0000 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # CHECK-BUILD function error { @@ -7,10 +7,19 @@ function error { exit 1 } +RC=0 + python -c ' import os.path, sys for p in sys.path: if os.path.exists(p + "/config/Makefile"): sys.exit(0) sys.exit(1) -' || error +' || RC=1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for python development environment FAILED" +fi + +exit ${RC} diff -r 7b6aba313aac -r afc6b5a60866 tools/check/check_udev --- a/tools/check/check_udev Thu Dec 14 15:43:40 2006 +0000 +++ b/tools/check/check_udev Thu Dec 14 16:00:31 2006 +0000 @@ -1,16 +1,33 @@ -#!/bin/bash +#!/bin/sh # CHECK-INSTALL -function error { - echo - echo ' *** Check for udev/hotplug FAILED' - exit 1 -} -[ -x "$(which udevinfo)" ] && \ - UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/') +RC=0 -if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then - exit 0 +case ${OS} in +OpenBSD|NetBSD|FreeBSD) + TOOL="vnconfig" + which ${TOOL} 1>/dev/null 2>&1 || RC=1 + ;; +Linux) + TOOL="udevinfo" + test -x "$(which ${TOOL})" && \ + UDEV_VERSION=$(${TOOL} -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/') + if test -n "${UDEV_VERSION}" -a ${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 -which hotplug 1>/dev/null 2>&1 || error +exit ${RC} diff -r 7b6aba313aac -r afc6b5a60866 tools/check/check_x11_devel --- a/tools/check/check_x11_devel Thu Dec 14 15:43:40 2006 +0000 +++ b/tools/check/check_x11_devel Thu Dec 14 16:00:31 2006 +0000 @@ -1,11 +1,15 @@ -#!/bin/bash +#!/bin/sh # CHECK-BUILD -function error { - echo - echo " *** Check for x11 headers FAILED" - exit 1 -} +RC=0 set -e -[ -e /usr/include/X11/keysymdef.h ] || error +test -r /usr/include/X11/keysymdef.h || \ +test -r /usr/X11R6/include/X11/keysymdef.h || RC=1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for x11 headers FAILED" +fi + +exit ${RC} _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |