All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christoph Egger" <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Portability patch for tools/check
Date: Thu, 14 Dec 2006 16:47:19 +0100	[thread overview]
Message-ID: <200612141647.19252.Christoph.Egger@amd.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 147 bytes --]


Hi!

I did a little off-list discussion with Jan.

Attached is a patch, which makes the non-portable scripts in tools/check 
portable.

Christoph

[-- Attachment #2: xen_tools_check.diff --]
[-- Type: text/x-diff, Size: 3389 bytes --]

diff -r 360eb996fa38 tools/check/check_crypto_lib
--- a/tools/check/check_crypto_lib	Wed Dec 13 16:13:26 2006 +0000
+++ b/tools/check/check_crypto_lib	Thu Dec 14 15:42:00 2006 +0100
@@ -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 360eb996fa38 tools/check/check_openssl_devel
--- a/tools/check/check_openssl_devel	Wed Dec 13 16:13:26 2006 +0000
+++ b/tools/check/check_openssl_devel	Thu Dec 14 15:45:32 2006 +0100
@@ -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 360eb996fa38 tools/check/check_python_devel
--- a/tools/check/check_python_devel	Wed Dec 13 16:13:26 2006 +0000
+++ b/tools/check/check_python_devel	Thu Dec 14 15:46:50 2006 +0100
@@ -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 360eb996fa38 tools/check/check_udev
--- a/tools/check/check_udev	Wed Dec 13 16:13:26 2006 +0000
+++ b/tools/check/check_udev	Thu Dec 14 16:28:56 2006 +0100
@@ -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 360eb996fa38 tools/check/check_x11_devel
--- a/tools/check/check_x11_devel	Wed Dec 13 16:13:26 2006 +0000
+++ b/tools/check/check_x11_devel	Thu Dec 14 15:50:22 2006 +0100
@@ -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}

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2006-12-14 15:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-14 15:47 Christoph Egger [this message]
2006-12-14 16:03 ` [PATCH] Portability patch for tools/check Guillaume Rousse
2006-12-14 17:16 ` 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=200612141647.19252.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.