# HG changeset patch # User Mads Kiilerich # Date 1245506815 -7200 # Node ID 8c97115547cc748b8b7890ea910e2ba93f5feb95 # Parent ff817723280acdb00906fdbd69e63c55f160d674 contrib/buildrpm: Don't use perl diff -r ff817723280a -r 8c97115547cc contrib/buildrpm --- 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(){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(){($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