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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH] yet another package check
From: "Christoph Egger" <Christoph.Egger@xxxxxxx>
Date: Thu, 14 Dec 2006 15:32:31 +0100
Delivery-date: Thu, 14 Dec 2006 06:32:48 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45815F50.6030101@xxxxxxxx>
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>
Organization: AMD / OSRC
References: <4581688F.76E4.0078.0@xxxxxxxxxx> <200612141522.15699.Christoph.Egger@xxxxxxx> <45815F50.6030101@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.4
On Thursday 14 December 2006 15:27, Guillaume Rousse wrote:
> Christoph Egger wrote:
> > Why do you write non-portable shell scripts?
> >
> > Some time ago, I made these portable:
> >
> > check_brctl
> > check_iproute
> > check_libvncserver
> > check_python
>
> I don't know if this one has been rewritten since stable version, but
> here is a patch I recently submited to the user list, to rely on python
> instead of ugly grep:
>
> diff -Naur xen-3.0.3_0-src/tools/check/check_python
> xen-3.0.3_0-src.better-python-check/tools/check/check_python
> --- xen-3.0.3_0-src/tools/check/check_python  2006-10-15
> 14:22:03.000000000 +0200
> +++ xen-3.0.3_0-src.better-python-check/tools/check/check_python
> 2006-12-11 16:26:01.000000000 +0100
> @@ -7,4 +7,4 @@
>      exit 1
>  }
>
> -python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || error
> +python -c 'import sys; sys.exit(sys.version_info[0] < 2 or
> sys.version_info[1] < 2);' || error

This is the adaption for -unstable:

diff -r 360eb996fa38 tools/check/check_python
--- a/tools/check/check_python  Wed Dec 13 16:13:26 2006 +0000
+++ b/tools/check/check_python  Thu Dec 14 15:31:18 2006 +0100
@@ -3,7 +3,7 @@
 
 RC=0
 
-python -V 2>&1 | cut -d ' ' -f 2 | grep -q '^2.[2345]' || RC=1
+python -c 'import sys; sys.exit(sys.version_info[0] < 2 or 
sys.version_info[1] < 2);' || RC=1 
 
 if test ${RC} -ne 0; then
        echo




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