From: Ewan Mellor Subject: Re: [PATCH] yet another package check (take 2) Date: Thu, 14 Dec 2006 16:47:16 +0000 Message-ID: <20061214164716.GA2717@leeni.uk.xensource.com> References: <45818894.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <45818894.76E4.0078.0@novell.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: Jan Beulich Cc: Christoph Egger , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Thu, Dec 14, 2006 at 04:23:32PM +0000, Jan Beulich wrote: > As before, the file added to tools/check/ must be given exec permission. > > Now using the approach suggested by Christoph Egger . > > [Snip] > > Index: 2006-12-11/tools/check/check_python_xml > =================================================================== > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > +++ 2006-12-11/tools/check/check_python_xml 2006-12-14 17:04:04.000000000 +0100 > @@ -0,0 +1,19 @@ > +#!/bin/sh > +# CHECK-INSTALL > + > +RC=0 > + > +python -c ' > +import os.path, sys > +for p in sys.path: > + if os.path.exists(p + "/xml/dom/minidom.py"): > + sys.exit(0) > +sys.exit(1) > +' || RC=1 > + > +if test ${RC} -ne 0; then > + echo > + echo " *** Check for python development environment FAILED" > +fi > + > +exit ${RC} How about if ! python -c 'import xml.dom.minidom' 2>/dev/null ; then echo echo " *** Check for python development environment FAILED" exit 1 else exit 0 fi Ewan.