Show More
@@ -26,7 +26,7 b' rpmdir=/tmp/"`basename $root | sed \'s/ /' | |||||
26 | cd "$root" |
|
26 | cd "$root" | |
27 | rm -rf $rpmdir |
|
27 | rm -rf $rpmdir | |
28 | mkdir -p $rpmdir/RPMS |
|
28 | mkdir -p $rpmdir/RPMS | |
29 | $HG clone "$root" $rpmdir/BUILD |
|
29 | $HG clone -u . "$root" $rpmdir/BUILD | |
30 |
|
30 | |||
31 | if [ ! -f $specfile ]; then |
|
31 | if [ ! -f $specfile ]; then | |
32 | echo "Cannot find $specfile!" 1>&2 |
|
32 | echo "Cannot find $specfile!" 1>&2 | |
@@ -34,11 +34,19 b' if [ ! -f $specfile ]; then' | |||||
34 | fi |
|
34 | fi | |
35 |
|
35 | |||
36 | tmpspec=/tmp/`basename "$specfile"`.$$ # FIXME: Insecure /tmp handling |
|
36 | tmpspec=/tmp/`basename "$specfile"`.$$ # FIXME: Insecure /tmp handling | |
37 | # Use the most recent tag as the version. |
|
37 | # make setup.py build the version string | |
38 | version=`$HG tags | python -c 'import sys; print [l for l in sys.stdin.readlines() if l[0].isdigit()][0].split()[0]'` |
|
38 | python setup.py build_py -c -d . | |
39 | # Compute the release number as the difference in revision numbers |
|
39 | hgversion=`$HG version | sed -ne 's/.*(version \(.*\))$/\1/p'` | |
40 | # between the tip and the most recent tag. |
|
40 | ||
41 | 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])'` |
|
41 | if echo $hgversion | grep -- '-' > /dev/null 2>&1; then | |
|
42 | # nightly build case, version is like 1.3.1+250-20b91f91f9ca | |||
|
43 | version=`echo $hgversion | cut -d- -f1` | |||
|
44 | release=`echo $hgversion | cut -d- -f2 | sed -e 's/+.*//'` | |||
|
45 | else | |||
|
46 | # official tag, version is like 1.3.1 | |||
|
47 | version=`echo $hgversion | sed -e 's/+.*//'` | |||
|
48 | release='0' | |||
|
49 | fi | |||
42 | tip=`$HG -q tip` |
|
50 | tip=`$HG -q tip` | |
43 |
|
51 | |||
44 | # Beat up the spec file |
|
52 | # Beat up the spec file |
General Comments 0
You need to be logged in to leave comments.
Login now