prepare for release candidate tags:
authorRobin Gareus <robin@gareus.org>
Thu, 8 Jan 2015 18:26:03 +0000 (19:26 +0100)
committerRobin Gareus <robin@gareus.org>
Thu, 8 Jan 2015 19:18:09 +0000 (20:18 +0100)
regexp: /[0—9]+-[0-9]+(-rc[0-9]*)?/
<Major>-<Minor>[-rc[<num>]]
valid tag examples: 4.0, 4.1-rc3, 5.0-rc

tools/define_versions.sh
tools/x-win/package.sh
wscript

index 654617a25330a14220344695984706100f60b681..c2f912d16da89c0b444af73a4aaee71c732a1936 100644 (file)
@@ -8,14 +8,17 @@ else
     EXTENDED_RE=-r
 fi
 
-GIT_REV_REGEXP='([0-9][0-9]*)\.([0-9][0-9]*)-?([0-9][0-9]*)?-?([a-z0-9]*)'
+GIT_REV_REGEXP='([0-9][0-9]*)\.([0-9][0-9]*)\-?(rc[0-9]*)?-?([0-9][0-9]*)?(-g([a-f0-9]+))?'
 
-major_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE  -e 1d -e "s/$GIT_REV_REGEXP/\1/"`
+major_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\1/"`
 minor_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\2/"`
-r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
-commit=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\4/"`
+rc=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
+r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\4/"`
+commit=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\6/"`
 
-if [ "x$r" != "x" ] ; then
+if [ "x$rc" != "x" ] ; then
+    revcount=$rc${r:+.$r}
+elif [ "x$r" != "x" ] ; then
     revcount=$r
 fi
 
index 023c5ca6458612170d23cb7a89bbd0c361ad6b16..cc1966ca157e94df3360511f927496fd17747096 100755 (executable)
@@ -70,7 +70,7 @@ set -e
 
 ARDOURVERSION=$(git describe | sed 's/-g.*$//')
 ARDOURDATE=$(date -R)
-BINVERSION=$(git describe | sed 's/-g.*$//' | sed 's/-/./')
+BINVERSION=$(git describe | sed 's/-g.*$//;s/\-rc\([^-]*\)-/-rc\1./;s/-/./;s/-.*$//')
 if ! test -f build/gtk2_ardour/ardour-${BINVERSION}.exe; then
        echo "*** Please compile ardour ${ARDOURVERSION} first."
        exit 1
diff --git a/wscript b/wscript
index aecc85a5c2724acb44cf145571ac9031d07630c7..e545b42b6159de6717af80d7f77ab98db3baa3c3 100644 (file)
--- a/wscript
+++ b/wscript
@@ -147,16 +147,16 @@ else:
     rev = fetch_tarball_revision ()
 
 #
-# rev is now of the form MAJOR.MINOR-rev-commit
-# or, if right at the same rev as a release, MAJOR.MINOR
+# rev is now of the form MAJOR.MINOR[-rcX]-rev-commit
+# or, if right at the same rev as a release, MAJOR.MINOR[-rcX]
 #
 
-parts = rev.split ('.')
+parts = rev.split ('.', 1)
 MAJOR = parts[0]
-other = parts[1].split ('-')
+other = parts[1].split('-', 1)
 MINOR = other[0]
 if len(other) > 1:
-    MICRO = other[1]
+    MICRO = other[1].rsplit('-',1)[0].replace('-','.')
 else:
     MICRO = '0'