From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Christoph Egger" Subject: Re: [PATCH] Minor fixes for non-Linux platforms Date: Thu, 12 Oct 2006 14:33:22 +0200 Message-ID: <200610121433.23484.Christoph.Egger@amd.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_TYjLFx85a2WYeOH" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_TYjLFx85a2WYeOH Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Friday 13 October 2006 13:54, Keir Fraser wrote: > On 13/10/06 10:56, "Bastian Blank" wrote: > >> diff -r f14a67a35bec tools/check/check_brctl > >> --- a/tools/check/check_brctl Thu Oct 12 17:53:51 2006 +0100 > >> +++ b/tools/check/check_brctl Thu Oct 12 10:17:33 2006 +0200 > >> @@ -1,4 +1,4 @@ > >> -#!/bin/bash > >> +#!/bin/sh > > > > Thats a bad idea. Some of the scripts uses non-POSIX extensions and > > /bin/sh is normaly only defined as POSIX compilant. > > The scripts are tiny. We should stop them using those non-compliant > extensions. We use /bin/sh in just about all our other scripts (and some of > those are *way* more complex). One more try. Patch attached. --Boundary-00=_TYjLFx85a2WYeOH Content-Type: text/x-diff; charset=iso-8859-1; name=tools_check.diff Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=tools_check.diff diff -r 49d096ef3d76 tools/check/check_brctl =2D-- a/tools/check/check_brctl Fri Oct 13 10:58:29 2006 +0100 +++ b/tools/check/check_brctl Thu Oct 12 14:31:08 2006 +0200 @@ -1,10 +1,25 @@ =2D#!/bin/bash +#!/bin/sh # CHECK-INSTALL =20 =2Dfunction error { =2D echo =2D echo ' *** Check for the bridge control utils (brctl) FAILED' =2D exit 1 =2D} +RC=3D0 =20 =2Dwhich brctl 1>/dev/null 2>&1 || error +case ${OS} in +OpenBSD|NetBSD|FreeBSD) + # These systems have a bridge builtin + which brconfig 1>/dev/null 2>&1 || RC=3D1=20 + ;; +Linux) + which brctl 1>/dev/null 2>&1 || RC=3D1=20 + ;; +*) + echo "Unknown OS" && error + ;; +esac + + +if test ${RC} -ne 0; then + echo + echo ' *** Check for the bridge control utils (brctl) FAILED' +fi + +exit ${RC}=20 diff -r 49d096ef3d76 tools/check/check_iproute =2D-- a/tools/check/check_iproute Fri Oct 13 10:58:29 2006 +0100 +++ b/tools/check/check_iproute Thu Oct 12 14:31:08 2006 +0200 @@ -1,11 +1,23 @@ =2D#!/bin/bash +#!/bin/sh # CHECK-INSTALL =20 =2Dfunction error { =2D echo =2D echo ' *** Check for iproute (ip addr) FAILED' =2D exit 1 =2D} +RC=3D0 =20 =2Dip addr list 1>/dev/null 2>&1 || error +case ${OS} in +OpenBSD|NetBSD|FreeBSD) + ifconfig -a 1>/dev/null 2>&1 || RC=3D1=20 + ;; +Linux) + ip addr list 1>/dev/null 2>&1 || RC=3D1=20 + ;; +*) + echo "Unknown OS" && RC=3D1=20 + ;; +esac =20 +if test ${RC} -ne 0; then + echo + echo ' *** Check for iproute (ip addr) FAILED' +fi + +exit ${RC}=20 diff -r 49d096ef3d76 tools/check/check_python =2D-- a/tools/check/check_python Fri Oct 13 10:58:29 2006 +0100 +++ b/tools/check/check_python Thu Oct 12 14:31:08 2006 +0200 @@ -1,10 +1,13 @@ =2D#!/bin/bash +#!/bin/sh # CHECK-BUILD CHECK-INSTALL =20 =2Dfunction error { =2D echo =2D echo " *** Check for Python version >=3D 2.2 FAILED" =2D exit 1 =2D} +RC=3D0 =20 =2Dpython -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || error +python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || RC=3D1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for Python version >=3D 2.2 FAILED" +fi + +exit ${RC}=20 diff -r 49d096ef3d76 tools/check/check_zlib_devel =2D-- a/tools/check/check_zlib_devel Fri Oct 13 10:58:29 2006 +0100 +++ b/tools/check/check_zlib_devel Thu Oct 12 14:31:08 2006 +0200 @@ -1,11 +1,14 @@ =2D#!/bin/bash +#!/bin/sh # CHECK-BUILD =20 =2Dfunction error { =2D echo =2D echo " *** Check for zlib headers FAILED" =2D exit 1 =2D} +RC=3D0 =20 set -e =2D[ -e /usr/include/zlib.h ] || error +test -r /usr/include/zlib.h || RC=3D1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for zlib headers FAILED" +fi=20 + +exit ${RC} diff -r 49d096ef3d76 tools/check/check_zlib_lib =2D-- a/tools/check/check_zlib_lib Fri Oct 13 10:58:29 2006 +0100 +++ b/tools/check/check_zlib_lib Thu Oct 12 14:31:08 2006 +0200 @@ -1,11 +1,14 @@ =2D#!/bin/bash +#!/bin/sh # CHECK-BUILD CHECK-INSTALL =20 =2Dfunction error { =2D echo =2D echo " *** Check for zlib library FAILED" =2D exit 1 =2D} +RC=3D0 =20 set -e =2Dldconfig -p | grep -q libz.so || error +ldconfig -v 2>&1 | grep -q libz.so || RC=3D1 + +if test ${RC} -ne 0; then + echo + echo " *** Check for zlib library FAILED" +fi + +exit ${RC}=20 diff -r 49d096ef3d76 tools/check/chk =2D-- a/tools/check/chk Fri Oct 13 10:58:29 2006 +0100 +++ b/tools/check/chk Thu Oct 12 14:31:08 2006 +0200 @@ -1,18 +1,7 @@ =2D#!/bin/bash =2D =2Dfunction usage { =2D echo "Usage:" =2D echo "\t$0 [build|install|clean]" =2D echo =2D echo "Check suitability for Xen build or install." =2D echo "Exit with 0 if OK, 1 if not." =2D echo "Prints only failed tests." =2D echo =2D echo "Calling with 'clean' removes generated files." =2D exit 1 =2D} +#!/bin/sh =20 export PATH=3D${PATH}:/sbin:/usr/sbin +export OS=3D`uname -s` =20 case $1 in build) @@ -25,7 +14,15 @@ case $1 in exit 0 ;; *) =2D usage + echo "Usage:" + echo "\t$0 [build|install|clean]" + echo + echo "Check suitability for Xen build or install." + echo "Exit with 0 if OK, 1 if not." + echo "Prints only failed tests." + echo + echo "Calling with 'clean' removes generated files." + exit 1 ;; esac =20 @@ -54,4 +51,4 @@ for f in check_* ; do fi done =20 =2Dexit $failed +exit ${failed} --Boundary-00=_TYjLFx85a2WYeOH Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_TYjLFx85a2WYeOH--