diff --git a/packaging/win32/build_package_git.sh b/packaging/win32/build_package_git.sh index 4851e3b690..62254e3441 100644 --- a/packaging/win32/build_package_git.sh +++ b/packaging/win32/build_package_git.sh @@ -69,12 +69,12 @@ rm -rf ${_DIST_UDIR} _BUILD_UDIR=`unix_path $BUILD_DIR` _GNUCASH_UDIR=`unix_path $GNUCASH_DIR` PKG_VERSION=`grep PACKAGE_VERSION ${_BUILD_UDIR}/config.h | cut -d" " -f3 | cut -d\" -f2 ` -SVN_REV=`grep GNUCASH_SVN_REV ${_BUILD_UDIR}/src/core-utils/gnc-svninfo.h | cut -d" " -f3 | cut -d\" -f2 ` +REVISION=`grep GNUCASH_SVN_REV ${_BUILD_UDIR}/src/core-utils/gnc-svninfo.h | cut -d" " -f3 | cut -d\" -f2 ` # Choose the output filename based on our "build_from_tarball" setting # Make sure this logic matches the logic in dist.sh! if [ "$BUILD_FROM_TARBALL" = "no" ]; then - SETUP_FILENAME="gnucash-${PKG_VERSION}-$(date +'%Y-%m-%d')-git-${SVN_REV}-setup.exe" + SETUP_FILENAME="gnucash-${PKG_VERSION}-$(date +'%Y-%m-%d')-git-${REVISION}-setup.exe" else SETUP_FILENAME="gnucash-${PKG_VERSION}-setup.exe" fi diff --git a/packaging/win32/daily_build.bat b/packaging/win32/daily_build.bat index 71ac3a4522..f477d070f3 100644 --- a/packaging/win32/daily_build.bat +++ b/packaging/win32/daily_build.bat @@ -2,7 +2,7 @@ rem This is the Windows Batch Script for the daily builds. rem It simply calls the actual MSYS Shell script to perform rem the daily build and then the tag builds. -cd c:\soft\packaging +cd c:\soft\gnucash\repos\packaging\win32\ rem Development build (daily) c:\msys\1.0\bin\sh.exe --login c:\soft\gnucash\repos\packaging\win32\daily_build_git.sh diff --git a/packaging/win32/daily_build_git.sh b/packaging/win32/daily_build_git.sh index f04d53537c..1fe585a08f 100644 --- a/packaging/win32/daily_build_git.sh +++ b/packaging/win32/daily_build_git.sh @@ -28,5 +28,26 @@ set_env "$_GIT_UDIR/bin/git" GIT_CMD export GIT_CMD $GIT_CMD pull -./build_package_git.sh + +################################################################ +# determine if there are any new commits since the last time we ran +# + +# If we don't have a rev file then start from 'now' and force a build +revfile=last_rev_daily +if [ ! -f ${revfile} ] ; then + echo $($GIT_CMD rev-parse HEAD) > ${revfile} + oldrev=a # definitely an invalid, so non-existing git rev +else + oldrev=$(cat ${revfile}) +fi + +newrev=$($GIT_CMD rev-parse HEAD) +if [[ "${oldrev}" != "${oldrev}" ]]; then + ./build_package_git.sh +fi + +# move the new file into place, will only happen if the build was successful +echo ${newrev} > ${revfile} + qpopd diff --git a/packaging/win32/weekly_build_git.sh b/packaging/win32/weekly_build_git.sh index 1e1a07abae..368a0a21f9 100644 --- a/packaging/win32/weekly_build_git.sh +++ b/packaging/win32/weekly_build_git.sh @@ -31,5 +31,26 @@ set_env "$_GIT_UDIR/bin/git" GIT_CMD export $GIT_CMD $GIT_CMD pull -./build_package.sh -qpopd + +################################################################ +# determine if there are any new commits since the last time we ran +# + +# If we don't have a rev file then start from 'now' and force a build +revfile=last_rev_weekly +if [ ! -f ${revfile} ] ; then + echo $($GIT_CMD rev-parse HEAD) > ${revfile} + oldrev=a # definitely an invalid, so non-existing git rev +else + oldrev=$(cat ${revfile}) +fi + +newrev=$($GIT_CMD rev-parse HEAD) +if [[ "${oldrev}" != "${oldrev}" ]]; then + ./build_package_git.sh +fi + +# move the new file into place, will only happen if the build was successful +echo ${newrev} > ${revfile} + +qpopd \ No newline at end of file