rearrange AutomationControl and RouteAutomationControl to get more shared logic and...
[ardour.git] / tools / define_versions.sh
1
2 # this is sourced by build and package, and executed from within build/{osx,linux}_packaging
3 #
4
5 if uname -a | grep arwin >/dev/null 2>&1 ; then
6     EXTENDED_RE=-E
7 else
8     EXTENDED_RE=-r
9 fi
10
11 GIT_REV_REGEXP='([0-9][0-9]*)\.([0-9][0-9]*)\-?(rc[0-9]*)?-?([0-9][0-9]*)?(-g([a-f0-9]+))?'
12
13 major_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\1/"`
14 minor_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\2/"`
15
16 # Tracks tags with "MAJOR.MINOR.MICRO"
17 # Ardour doesn't use this
18
19 micro_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
20
21 #
22 # RC e.g. 8.1-rc3 (optional)
23 # Tracks does not use -rcN based tagging
24 #
25 rc=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
26
27 #
28 # revision count since tag
29 #
30 r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\4/"`
31
32 #
33 # git short sha1 commit ID
34 #
35 commit=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\6/"`
36
37 if [ "x$rc" != "x" ] ; then
38     revcount=$rc${r:+.$r}
39 elif [ "x$r" != "x" ] ; then
40     revcount=$r
41 else
42     revcount=0
43 fi
44
45 release_version=${major_version}.${minor_version}${revcount:+.$revcount}
46
47 #
48 # Figure out the Build Type
49 #
50 # Note that the name of the cache file may vary from to time
51 #
52
53 if grep -q "DEBUG = True" ../../build/c4che/_cache.py; then
54         DEBUG="T"
55 else
56         DEBUG="F"
57 fi