From: Ewan Mellor Subject: Re: [PATCH] Portability patch for tools/check Date: Thu, 14 Dec 2006 17:16:07 +0000 Message-ID: <20061214171607.GC3748@leeni.uk.xensource.com> References: <200612141647.19252.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <200612141647.19252.Christoph.Egger@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Christoph Egger Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thu, Dec 14, 2006 at 04:47:19PM +0100, Christoph Egger wrote: > > 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 > > [Snip] > > 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} So we now have an uncalled error function at the top of the script. Is this intentional? What's non-portable about functions anyway? POSIX.1 defines a function definition syntax (http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html). Ewan.