From 3e661d97b57047144336253f79d679a7300aead8 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 5 Nov 2013 09:35:03 -0500 Subject: update packaging tools to always use revision.cc to determine version number, not text in top level wscript --- tools/define_versions.sh | 25 +++++++++++++++++-------- tools/linux_packaging/build | 18 +++++++++++------- tools/linux_packaging/package | 16 ++++++++-------- tools/osx_packaging/osx_build | 20 ++++++++++++-------- 4 files changed, 48 insertions(+), 31 deletions(-) diff --git a/tools/define_versions.sh b/tools/define_versions.sh index 6f5c17773c..654617a253 100644 --- a/tools/define_versions.sh +++ b/tools/define_versions.sh @@ -2,15 +2,24 @@ # this is sourced by build and package, and executed from within build/{osx,linux}_packaging # -major_version=`grep -m 1 '^MAJOR = ' ../../wscript | awk '{print $3}' | sed "s/'//g"` -minor_version=`grep -m 1 '^MINOR = ' ../../wscript | awk '{print $3}' | sed "s/'//g"` -release_version=${major_version}.${minor_version} -r=`cut -d'"' -f2 < ../../libs/ardour/revision.cc | sed -e 1d -e "s/[0-9][0-9]*\.[0-9][0-9]*-//"` -if echo $r | grep -q -e - ; then - revcount=`echo $r | cut -d- -f1` +if uname -a | grep arwin >/dev/null 2>&1 ; then + EXTENDED_RE=-E +else + EXTENDED_RE=-r +fi + +GIT_REV_REGEXP='([0-9][0-9]*)\.([0-9][0-9]*)-?([0-9][0-9]*)?-?([a-z0-9]*)' + +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/"` + +if [ "x$r" != "x" ] ; then + revcount=$r fi -commit=`echo $r | cut -d- -f2` -version=${release_version}${revcount:+.$revcount} + +release_version=${major_version}.${minor_version}${revcount:+.$revcount} # # Figure out the Build Type diff --git a/tools/linux_packaging/build b/tools/linux_packaging/build index e7f7d8b6dd..e8cc4d53b2 100755 --- a/tools/linux_packaging/build +++ b/tools/linux_packaging/build @@ -97,8 +97,12 @@ fi . ../define_versions.sh -echo "Version is $version / $commit" -info_string="$version ($commit) built on `hostname` by `whoami` on `date`" +echo "Version is $release_version" +if [ "x$commit" != "x" ] ; then + info_string="$release_version ($commit) built on `hostname` by `whoami` on `date`" +else + info_string="$release_version built on `hostname` by `whoami` on `date`" +fi echo "Info string is $info_string" # Figure out our CPU type @@ -134,11 +138,11 @@ fi # setup directory structure if [ -z "${BUILDTYPE}" ]; then - APPDIR=${APPNAME}_${ARCH}-${version} - APP_VER_NAME=${APPNAME}-${version} + APPDIR=${APPNAME}_${ARCH}-${release_version} + APP_VER_NAME=${APPNAME}-${release_version} else - APPDIR=${APPNAME}_${ARCH}-${version}-${BUILDTYPE} - APP_VER_NAME=${APPNAME}-${version}-${BUILDTYPE} + APPDIR=${APPNAME}_${ARCH}-${release_version}-${BUILDTYPE} + APP_VER_NAME=${APPNAME}-${release_version}-${BUILDTYPE} fi APPBIN=$APPDIR/bin @@ -569,7 +573,7 @@ fi # # Add the uninstaller # -sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${version}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh +sed -e "s/%REPLACE_PGM%/${APPNAME}/" -e "s/%REPLACE_VENDOR%/${VENDOR}/" -e "s/%REPLACE_VERSION%/${release_version}/" -e "s/%REPLACE_TYPE%/${BUILDTYPE}/" < uninstall.sh.in > $APPBIN/${APP_VER_NAME}.uninstall.sh chmod a+x $APPBIN/${APP_VER_NAME}.uninstall.sh #Sanity Check file diff --git a/tools/linux_packaging/package b/tools/linux_packaging/package index 259a2a22da..5fc6aee1f7 100755 --- a/tools/linux_packaging/package +++ b/tools/linux_packaging/package @@ -56,8 +56,8 @@ if [ x$DEBUG = xT ]; then BUILDTYPE="dbg" fi -X86_BUNDLE="${APPNAME}_x86-${version}" -X86_64_BUNDLE="${APPNAME}_x86_64-${version}" +X86_BUNDLE="${APPNAME}_x86-${release_version}" +X86_64_BUNDLE="${APPNAME}_x86_64-${release_version}" if [ ! -z ${BUILDTYPE} ]; then X86_BUNDLE="${X86_BUNDLE}-${BUILDTYPE}" @@ -112,22 +112,22 @@ fi if [ -z ${BUILDTYPE} ]; then if [ "${SINGLE_ARCH}" = "T" ]; then if [ "${X86_BUNDLE_OK}" = "T" ]; then - PACKAGE="${APPNAME}_32bit-${version}" + PACKAGE="${APPNAME}_32bit-${release_version}" else - PACKAGE="${APPNAME}_64bit-${version}" + PACKAGE="${APPNAME}_64bit-${release_version}" fi else - PACKAGE="${APPNAME}-${version}" + PACKAGE="${APPNAME}-${release_version}" fi else if [ "${SINGLE_ARCH}" = "T" ]; then if [ "${X86_BUNDLE_OK}" = "T" ]; then - PACKAGE="${APPNAME}_32bit-${version}-${BUILDTYPE}" + PACKAGE="${APPNAME}_32bit-${release_version}-${BUILDTYPE}" else - PACKAGE="${APPNAME}_64bit-${version}-${BUILDTYPE}" + PACKAGE="${APPNAME}_64bit-${release_version}-${BUILDTYPE}" fi else - PACKAGE="${APPNAME}-${version}-${BUILDTYPE}" + PACKAGE="${APPNAME}-${release_version}-${BUILDTYPE}" fi fi diff --git a/tools/osx_packaging/osx_build b/tools/osx_packaging/osx_build index c47e64483c..fcf1febe84 100755 --- a/tools/osx_packaging/osx_build +++ b/tools/osx_packaging/osx_build @@ -75,8 +75,12 @@ if test -z "$PRODUCT_PKG_DIR" -o -z "$APPNAME"; then fi . ../define_versions.sh -echo "Version is $release_version / $revision" -info_string="$version built on `hostname` by `whoami` on `date`" +echo "Version is $release_version" +if [ "x$commit" != "x" ] ; then + info_string="$release_version ($commit) built on `hostname` by `whoami` on `date`" +else + info_string="$release_version built on `hostname` by `whoami` on `date`" +fi echo "Info string is $info_string" # setup directory structure @@ -177,12 +181,12 @@ env="LSEnvironment$envARDOUR_BUNDLEDtrue Info.plist # and plist strings sed -e "s?@APPNAME@?$appname?" \ -e "s?@ENV@?$env?g" \ - -e "s?@VERSION@?$release_version/$revision?g" \ + -e "s?@VERSION@?$release_version?g" \ -e "s?@INFOSTRING@?$info_string?g" < InfoPlist.strings.in > Resources/InfoPlist.strings || exit 1 # copy static files @@ -569,10 +573,10 @@ fi echo "Building DMG ..." -# UC_DMG=$APPNAME-${release_version}-${revision}-UC.dmg -# FINAL_DMG=$APPNAME-${release_version}-${revision}.dmg -UC_DMG=$APPNAME-$version.dmg -VOLNAME=$APPNAME-$version +# UC_DMG=$APPNAME-${release_version}-UC.dmg +# FINAL_DMG=$APPNAME-${release_version}.dmg +UC_DMG=$APPNAME-$release_version.dmg +VOLNAME=$APPNAME-$release_version # TODO use mktemp export TMPDIR=`pwd` -- cgit v1.2.3