WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] yet another package check (take 2)

To: Jan Beulich <jbeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] yet another package check (take 2)
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Thu, 14 Dec 2006 16:47:16 +0000
Cc: Christoph Egger <Christoph.Egger@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 14 Dec 2006 08:47:13 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45818894.76E4.0078.0@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <45818894.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
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 <Christoph.Egger@xxxxxxx>.
>
> [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.

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