2 # this is sourced by build and package, and executed from within build/{osx,linux}_packaging
5 if uname -a | grep arwin >/dev/null 2>&1 ; then
11 GIT_REV_REGEXP='([0-9][0-9]*)\.([0-9][0-9]*)\-?(rc[0-9]*)?-?([0-9][0-9]*)?(-g([a-f0-9]+))?'
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/"`
16 # Tracks tags with "MAJOR.MINOR.MICRO"
17 # Ardour doesn't use this
19 micro_version=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
22 # RC e.g. 8.1-rc3 (optional)
23 # Tracks does not use -rcN based tagging
25 rc=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\3/"`
28 # revision count since tag
30 r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\4/"`
33 # git short sha1 commit ID
35 commit=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed $EXTENDED_RE -e 1d -e "s/$GIT_REV_REGEXP/\6/"`
37 if [ "x$rc" != "x" ] ; then
39 elif [ "x$r" != "x" ] ; then
45 release_version=${major_version}.${minor_version}${revcount:+.$revcount}
48 # Figure out the Build Type
50 # Note that the name of the cache file may vary from to time
53 if grep -q "DEBUG = True" ../../build/c4che/_cache.py; then