ia64/xen-unstable

changeset 13032:afc6b5a60866

[TOOLS] Fix check-script compatibility with non-bash shells.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Dec 14 16:00:31 2006 +0000 (2006-12-14)
parents 7b6aba313aac
children cd89771ba550
files tools/check/check_crypto_lib tools/check/check_openssl_devel tools/check/check_python_devel tools/check/check_udev tools/check/check_x11_devel
line diff
     1.1 --- a/tools/check/check_crypto_lib	Thu Dec 14 15:43:40 2006 +0000
     1.2 +++ b/tools/check/check_crypto_lib	Thu Dec 14 16:00:31 2006 +0000
     1.3 @@ -1,11 +1,14 @@
     1.4 -#!/bin/bash
     1.5 +#!/bin/sh
     1.6  # CHECK-BUILD CHECK-INSTALL
     1.7  
     1.8 -function error {
     1.9 -    echo
    1.10 -    echo "  *** Check for crypto library FAILED"
    1.11 -    exit 1
    1.12 -}
    1.13 +RC=0
    1.14  
    1.15  set -e
    1.16 -ldconfig -p | grep -q libcrypto.so || error
    1.17 +ldconfig -v 2>&1 | grep -q libcrypto.so || RC=1
    1.18 +
    1.19 +if test ${RC} -ne 0; then
    1.20 +        echo
    1.21 +        echo " *** Check for crypto library FAILED"
    1.22 +fi
    1.23 +
    1.24 +exit ${RC}
     2.1 --- a/tools/check/check_openssl_devel	Thu Dec 14 15:43:40 2006 +0000
     2.2 +++ b/tools/check/check_openssl_devel	Thu Dec 14 16:00:31 2006 +0000
     2.3 @@ -1,11 +1,14 @@
     2.4 -#!/bin/bash
     2.5 +#!/bin/sh
     2.6  # CHECK-BUILD
     2.7  
     2.8 -function error {
     2.9 -    echo
    2.10 -    echo "  *** Check for openssl headers FAILED"
    2.11 -    exit 1
    2.12 -}
    2.13 +RC=0
    2.14  
    2.15  set -e
    2.16 -[ -e /usr/include/openssl/md5.h ] || error
    2.17 +test -r /usr/include/openssl/md5.h || RC=1 
    2.18 +
    2.19 +if test ${RC} -ne 0; then
    2.20 +	echo
    2.21 +	echo " *** Check for openssl headers FAILED"
    2.22 +fi
    2.23 +
    2.24 +exit ${RC}
     3.1 --- a/tools/check/check_python_devel	Thu Dec 14 15:43:40 2006 +0000
     3.2 +++ b/tools/check/check_python_devel	Thu Dec 14 16:00:31 2006 +0000
     3.3 @@ -1,4 +1,4 @@
     3.4 -#!/bin/bash
     3.5 +#!/bin/sh
     3.6  # CHECK-BUILD
     3.7  
     3.8  function error {
     3.9 @@ -7,10 +7,19 @@ function error {
    3.10      exit 1
    3.11  }
    3.12  
    3.13 +RC=0
    3.14 +
    3.15  python -c '
    3.16  import os.path, sys
    3.17  for p in sys.path:
    3.18  	if os.path.exists(p + "/config/Makefile"):
    3.19  		sys.exit(0)
    3.20  sys.exit(1)
    3.21 -' || error
    3.22 +' || RC=1 
    3.23 +
    3.24 +if test ${RC} -ne 0; then
    3.25 +	echo
    3.26 +	echo " *** Check for python development environment FAILED"
    3.27 +fi
    3.28 +
    3.29 +exit ${RC}
     4.1 --- a/tools/check/check_udev	Thu Dec 14 15:43:40 2006 +0000
     4.2 +++ b/tools/check/check_udev	Thu Dec 14 16:00:31 2006 +0000
     4.3 @@ -1,16 +1,33 @@
     4.4 -#!/bin/bash
     4.5 +#!/bin/sh
     4.6  # CHECK-INSTALL
     4.7  
     4.8 -function error {
     4.9 -   echo
    4.10 -   echo '  *** Check for udev/hotplug FAILED'
    4.11 -   exit 1
    4.12 -}
    4.13 -[ -x "$(which udevinfo)" ] && \
    4.14 -  UDEV_VERSION=$(udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
    4.15 +RC=0
    4.16  
    4.17 -if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
    4.18 -  exit 0
    4.19 +case ${OS} in
    4.20 +OpenBSD|NetBSD|FreeBSD)
    4.21 +	TOOL="vnconfig"
    4.22 +	which ${TOOL} 1>/dev/null 2>&1 || RC=1
    4.23 +	;;
    4.24 +Linux)
    4.25 +	TOOL="udevinfo"
    4.26 +	test -x "$(which ${TOOL})" && \
    4.27 +		UDEV_VERSION=$(${TOOL} -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
    4.28 +	if test -n "${UDEV_VERSION}" -a ${UDEV_VERSION} -ge 059; then
    4.29 +		RC=0
    4.30 +	else
    4.31 +		TOOL="hotplug"
    4.32 +		which ${TOOL} 1>/dev/null 2>&1 || RC=1
    4.33 +	fi
    4.34 +	;;
    4.35 +*)
    4.36 +	TOOL=""
    4.37 +	echo "Unknown OS" && RC=1
    4.38 +	;;
    4.39 +esac
    4.40 +
    4.41 +if test ${RC} -ne 0; then
    4.42 +	echo
    4.43 +	echo ' *** Check for ${TOOL} FAILED'
    4.44  fi
    4.45  
    4.46 -which hotplug 1>/dev/null 2>&1 || error
    4.47 +exit ${RC}
     5.1 --- a/tools/check/check_x11_devel	Thu Dec 14 15:43:40 2006 +0000
     5.2 +++ b/tools/check/check_x11_devel	Thu Dec 14 16:00:31 2006 +0000
     5.3 @@ -1,11 +1,15 @@
     5.4 -#!/bin/bash
     5.5 +#!/bin/sh
     5.6  # CHECK-BUILD
     5.7  
     5.8 -function error {
     5.9 -    echo
    5.10 -    echo "  *** Check for x11 headers FAILED"
    5.11 -    exit 1
    5.12 -}
    5.13 +RC=0
    5.14  
    5.15  set -e
    5.16 -[ -e /usr/include/X11/keysymdef.h ] || error
    5.17 +test -r /usr/include/X11/keysymdef.h || \
    5.18 +test -r /usr/X11R6/include/X11/keysymdef.h || RC=1
    5.19 +
    5.20 +if test ${RC} -ne 0; then
    5.21 +	echo
    5.22 +	echo " *** Check for x11 headers FAILED"
    5.23 +fi
    5.24 +
    5.25 +exit ${RC}