# HG changeset patch # User Mads Kiilerich # Date 2009-06-20 14:06:55 # Node ID 8c97115547cc748b8b7890ea910e2ba93f5feb95 # Parent ff817723280acdb00906fdbd69e63c55f160d674 contrib/buildrpm: Don't use perl diff --git a/contrib/buildrpm b/contrib/buildrpm --- a/contrib/buildrpm +++ b/contrib/buildrpm @@ -37,10 +37,10 @@ fi 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