changeset 8868:8c97115547cc

contrib/buildrpm: Don't use perl
author Mads Kiilerich <mads@kiilerich.com>
date Sat, 20 Jun 2009 16:06:55 +0200
parents ff817723280a
children d244ee52ac30
files contrib/buildrpm
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/buildrpm	Sat Jun 20 16:06:54 2009 +0200
+++ b/contrib/buildrpm	Sat Jun 20 16:06:55 2009 +0200
@@ -37,10 +37,10 @@
 
 tmpspec=/tmp/`basename "$specfile"`.$$ # FIXME: Insecure /tmp handling
 # Use the most recent tag as the version.
-version=`hg tags | perl -e 'while(<STDIN>){if(/^(\d\S+)/){print$1;exit}}'`
+version=`hg tags | python -c 'import sys; print [l for l in sys.stdin.readlines() if l[0].isdigit()][0].split()[0]'`
 # Compute the release number as the difference in revision numbers
 # between the tip and the most recent tag.
-release=`hg tags | perl -e 'while(<STDIN>){($tag,$id)=/^(\S+)\s+(\d+)/;if($tag eq "tip"){$tip = $id}elsif($tag=~/^\d/){print $tip-$id+1;exit}}'`
+release=`hg tags | python -c 'import sys; l = sys.stdin.readlines(); print int(l[0].split()[1].split(":")[0]) - int([x for x in l if x[0].isdigit()][0].split()[1].split(":")[0])'`
 tip=`hg -q tip`
 
 # Beat up the spec file