From: "Christoph Egger" <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Minor fixes for non-Linux platforms
Date: Thu, 12 Oct 2006 14:33:22 +0200 [thread overview]
Message-ID: <200610121433.23484.Christoph.Egger@amd.com> (raw)
In-Reply-To: <C1553CF2.27BE%Keir.Fraser@cl.cam.ac.uk>
[-- Attachment #1: Type: text/plain, Size: 703 bytes --]
On Friday 13 October 2006 13:54, Keir Fraser wrote:
> On 13/10/06 10:56, "Bastian Blank" <bastian@waldi.eu.org> 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.
[-- Attachment #2: tools_check.diff --]
[-- Type: text/x-diff, Size: 4250 bytes --]
diff -r 49d096ef3d76 tools/check/check_brctl
--- 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 @@
-#!/bin/bash
+#!/bin/sh
# CHECK-INSTALL
-function error {
- echo
- echo ' *** Check for the bridge control utils (brctl) FAILED'
- exit 1
-}
+RC=0
-which 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=1
+ ;;
+Linux)
+ which brctl 1>/dev/null 2>&1 || RC=1
+ ;;
+*)
+ echo "Unknown OS" && error
+ ;;
+esac
+
+
+if test ${RC} -ne 0; then
+ echo
+ echo ' *** Check for the bridge control utils (brctl) FAILED'
+fi
+
+exit ${RC}
diff -r 49d096ef3d76 tools/check/check_iproute
--- 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 @@
-#!/bin/bash
+#!/bin/sh
# CHECK-INSTALL
-function error {
- echo
- echo ' *** Check for iproute (ip addr) FAILED'
- exit 1
-}
+RC=0
-ip addr list 1>/dev/null 2>&1 || error
+case ${OS} in
+OpenBSD|NetBSD|FreeBSD)
+ ifconfig -a 1>/dev/null 2>&1 || RC=1
+ ;;
+Linux)
+ ip addr list 1>/dev/null 2>&1 || RC=1
+ ;;
+*)
+ echo "Unknown OS" && RC=1
+ ;;
+esac
+if test ${RC} -ne 0; then
+ echo
+ echo ' *** Check for iproute (ip addr) FAILED'
+fi
+
+exit ${RC}
diff -r 49d096ef3d76 tools/check/check_python
--- 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 @@
-#!/bin/bash
+#!/bin/sh
# CHECK-BUILD CHECK-INSTALL
-function error {
- echo
- echo " *** Check for Python version >= 2.2 FAILED"
- exit 1
-}
+RC=0
-python -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=1
+
+if test ${RC} -ne 0; then
+ echo
+ echo " *** Check for Python version >= 2.2 FAILED"
+fi
+
+exit ${RC}
diff -r 49d096ef3d76 tools/check/check_zlib_devel
--- 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 @@
-#!/bin/bash
+#!/bin/sh
# CHECK-BUILD
-function error {
- echo
- echo " *** Check for zlib headers FAILED"
- exit 1
-}
+RC=0
set -e
-[ -e /usr/include/zlib.h ] || error
+test -r /usr/include/zlib.h || RC=1
+
+if test ${RC} -ne 0; then
+ echo
+ echo " *** Check for zlib headers FAILED"
+fi
+
+exit ${RC}
diff -r 49d096ef3d76 tools/check/check_zlib_lib
--- 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 @@
-#!/bin/bash
+#!/bin/sh
# CHECK-BUILD CHECK-INSTALL
-function error {
- echo
- echo " *** Check for zlib library FAILED"
- exit 1
-}
+RC=0
set -e
-ldconfig -p | grep -q libz.so || error
+ldconfig -v 2>&1 | grep -q libz.so || RC=1
+
+if test ${RC} -ne 0; then
+ echo
+ echo " *** Check for zlib library FAILED"
+fi
+
+exit ${RC}
diff -r 49d096ef3d76 tools/check/chk
--- 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 @@
-#!/bin/bash
-
-function 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
-}
+#!/bin/sh
export PATH=${PATH}:/sbin:/usr/sbin
+export OS=`uname -s`
case $1 in
build)
@@ -25,7 +14,15 @@ case $1 in
exit 0
;;
*)
- 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
@@ -54,4 +51,4 @@ for f in check_* ; do
fi
done
-exit $failed
+exit ${failed}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2006-10-12 12:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-12 8:33 [PATCH] Minor fixes for non-Linux platforms Christoph Egger
2006-10-13 9:56 ` Bastian Blank
2006-10-13 11:54 ` Keir Fraser
2006-10-12 12:33 ` Christoph Egger [this message]
2006-10-13 16:45 ` Christian Limpach
2006-10-13 21:27 ` Aron Griffis
2006-10-15 8:39 ` Christoph Egger
2006-10-17 14:08 ` Christoph Egger
2006-10-13 21:56 ` Aron Griffis
2006-10-14 15:29 ` Ewan Mellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200610121433.23484.Christoph.Egger@amd.com \
--to=christoph.egger@amd.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.