gnucash-on-windows master: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Wed Oct 8 05:57:45 EDT 2014


Updated	 via  https://github.com/Gnucash/gnucash-on-windows/commit/409efbd7 (commit)
	 via  https://github.com/Gnucash/gnucash-on-windows/commit/9f2d0f08 (commit)
	 via  https://github.com/Gnucash/gnucash-on-windows/commit/576134d4 (commit)
	 via  https://github.com/Gnucash/gnucash-on-windows/commit/042af15a (commit)
	 via  https://github.com/Gnucash/gnucash-on-windows/commit/f46b85cb (commit)
	 via  https://github.com/Gnucash/gnucash-on-windows/commit/9d19d0c0 (commit)
	from  https://github.com/Gnucash/gnucash-on-windows/commit/a5f58d1a (commit)



commit 409efbd7d4cb47a3ed18c9ec509c90c35ffcbcfb
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Wed Oct 8 13:51:48 2014 +0200

    Handle more tag variations correctly in major_minor function

diff --git a/functions.sh b/functions.sh
index 2e1618d..a633073 100644
--- a/functions.sh
+++ b/functions.sh
@@ -307,12 +307,8 @@ function mingw_smart_get () {
 # If the version entered is not a version in the expected format
 # 0 will be returned.
 function get_major_minor () {
-  local version=${1//[!0-9.-]/}
-
-  local -i version_major=${version%%.*}
-  local version_tmp=${version#*.}
-  local -i version_minor=${version_tmp%%.*}
-  major_minor=$(( $version_major*100 + $version_minor ))
+  version=$1
+  major_minor=$(perl  -e '($maj,$min,$rest) = <>  =~ /([0-9]*)[.]([0-9]*)(.*)/; print $maj*100+$min;' <<< $version)
 }
 
 ### Local Variables: ***

commit 9f2d0f087978705d133500115a7abae0de0e5bb1
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Tue Oct 7 22:39:31 2014 +0200

    Build server: some more logging

diff --git a/buildserver/build_periodic.sh b/buildserver/build_periodic.sh
index 20e14fe..3336b7d 100644
--- a/buildserver/build_periodic.sh
+++ b/buildserver/build_periodic.sh
@@ -48,6 +48,7 @@ set_env "$_GIT_UDIR/bin/git" GIT_CMD
 export GIT_CMD
 
 # Update the gnucash-on-windows build scripts
+echo "Pulling latest changes from gnucash-on-windows..."
 _GC_WIN_REPOS_UDIR=`unix_path $GC_WIN_REPOS_DIR`
 qpushd "$_GC_WIN_REPOS_UDIR"
 $GIT_CMD pull
@@ -60,6 +61,7 @@ _REPOS_UDIR=`unix_path $REPOS_DIR`
 qpushd "$_REPOS_UDIR"
 
 # Update the gnucash repository
+echo "Pulling latest changes from gnucash.git..."
 $GIT_CMD pull
 # If we don't have a rev file then start from 'now' and force a build
 revfile=$_GC_WIN_REPOS_UDIR/last_rev_periodic
diff --git a/buildserver/build_tags.sh b/buildserver/build_tags.sh
index b89b9d8..c1d6826 100644
--- a/buildserver/build_tags.sh
+++ b/buildserver/build_tags.sh
@@ -90,11 +90,13 @@ for tag_rev in $tags ; do
   tag_hash=${tag_rev#*/}
   tag=${tag_rev%/*}
 
+  echo "Building tag $tag"
+
   # Git builds are only supported from 2.5 up
   get_major_minor $tag
   if (( $major_minor < 205 ))
   then
-     echo "Skipping build of tag $tag (reason: older than 2.5)"
+     echo "  *** Tag $tag is older than 2.5 or not a release tag. Skipping."
   else
 
     TAG_GLOBAL_DIR="c:\\gcdev\\gnucash-${tag}"

commit 576134d4b637ec35f40608174d26119ab4f0c639
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Tue Oct 7 17:36:36 2014 +0200

    Build server: also mark deliberately skipped tags as built

diff --git a/buildserver/build_tags.sh b/buildserver/build_tags.sh
index cee4697..b89b9d8 100644
--- a/buildserver/build_tags.sh
+++ b/buildserver/build_tags.sh
@@ -95,51 +95,52 @@ for tag_rev in $tags ; do
   if (( $major_minor < 205 ))
   then
      echo "Skipping build of tag $tag (reason: older than 2.5)"
-     continue
-  fi
+  else
 
-  TAG_GLOBAL_DIR="c:\\gcdev\\gnucash-${tag}"
-  _TAG_GLOBAL_UDIR=$(unix_path "$TAG_GLOBAL_DIR")
-  rm -fr $_TAG_GLOBAL_UDIR
-
-  # Set up a clean build environment for this tag
-  # This will automatically create a custom.sh with
-  # several parameters correctly pre-set like
-  # GLOBAL_DIR, DOWNLOAD_DIR,...
-  cscript.exe $_GC_WIN_REPOS_UDIR/bootstrap_win_dev.vbs /silent:yes /GLOBAL_DIR:$TAG_GLOBAL_DIR /DOWNLOAD_DIR:$DOWNLOAD_DIR /GIT_DIR:$GIT_DIR
-
-  # Check out the tag and setup custom.sh
-  echo "Checking out tag $tag"
-  TAG_REPOS_DIR="${TAG_GLOBAL_DIR}\\gnucash.git"
-  _TAG_REPOS_UDIR=$(unix_path "$TAG_REPOS_DIR")
-  qpushd $TAG_REPOS_DIR
-  $GIT_CMD checkout $tag
-  qpopd
-
-  TAG_WIN_REPOS_DIR="${TAG_GLOBAL_DIR}\\gnucash-on-windows.git"
-  _TAG_WIN_REPOS_UDIR=$(unix_path "$TAG_WIN_REPOS_DIR")
-
-  # BUILD_FROM_TARBALL is special:
-  # in install.sh place we check !=yes, in defaults.sh =yes, in dist.sh =no
-  # We want it to look like 'no' in install and defaults, but yes in dist
-  # so this hack works!
-  echo "BUILD_FROM_TARBALL=maybe" >> ${_TAG_WIN_REPOS_UDIR}/custom.sh
-
-  # Point HH_DIR at the global installation because we don't need to redo it
-  echo -n "HH_DIR=" >> ${_TAG_WIN_REPOS_UDIR}/custom.sh
-  echo "${GLOBAL_DIR}\\hh" | sed -e 's/\\/\\\\/g' >> ${_TAG_WIN_REPOS_UDIR}/custom.sh
-
-  # Inform the build scripts of the tag we're building.
-  echo "GNUCASH_SCM_REV=$tag" >> ${_TAG_WIN_REPOS_UDIR}/custom.sh
-
-  # Now build the tag!  (this will upload it too)
-  # Use the build_package script from master (cwd), not from the tag
-  qpushd ${_TAG_WIN_REPOS_UDIR}
-    ${BUILDSERVER_DIR}/build_package.sh ${tag}
-  qpopd
+    TAG_GLOBAL_DIR="c:\\gcdev\\gnucash-${tag}"
+    _TAG_GLOBAL_UDIR=$(unix_path "$TAG_GLOBAL_DIR")
+    rm -fr $_TAG_GLOBAL_UDIR
+
+    # Set up a clean build environment for this tag
+    # This will automatically create a custom.sh with
+    # several parameters correctly pre-set like
+    # GLOBAL_DIR, DOWNLOAD_DIR,...
+    cscript.exe $_GC_WIN_REPOS_UDIR/bootstrap_win_dev.vbs /silent:yes /GLOBAL_DIR:$TAG_GLOBAL_DIR /DOWNLOAD_DIR:$DOWNLOAD_DIR /GIT_DIR:$GIT_DIR
+
+    # Check out the tag and setup custom.sh
+    echo "Checking out tag $tag"
+    TAG_REPOS_DIR="${TAG_GLOBAL_DIR}\\gnucash.git"
+    _TAG_REPOS_UDIR=$(unix_path "$TAG_REPOS_DIR")
+    qpushd $TAG_REPOS_DIR
+      $GIT_CMD checkout $tag
+    qpopd
+
+    TAG_WIN_REPOS_DIR="${TAG_GLOBAL_DIR}\\gnucash-on-windows.git"
+    _TAG_WIN_REPOS_UDIR=$(unix_path "$TAG_WIN_REPOS_DIR")
+
+    # BUILD_FROM_TARBALL is special:
+    # in install.sh place we check !=yes, in defaults.sh =yes, in dist.sh =no
+    # We want it to look like 'no' in install and defaults, but yes in dist
+    # so this hack works!
+    echo "BUILD_FROM_TARBALL=maybe" >> ${_TAG_WIN_REPOS_UDIR}/custom.sh
+
+    # Point HH_DIR at the global installation because we don't need to redo it
+    echo -n "HH_DIR=" >> ${_TAG_WIN_REPOS_UDIR}/custom.sh
+    echo "${GLOBAL_DIR}\\hh" | sed -e 's/\\/\\\\/g' >> ${_TAG_WIN_REPOS_UDIR}/custom.sh
+
+    # Inform the build scripts of the tag we're building.
+    echo "GNUCASH_SCM_REV=$tag" >> ${_TAG_WIN_REPOS_UDIR}/custom.sh
+
+    # Now build the tag!  (this will upload it too)
+    # Use the build_package script from master (cwd), not from the tag
+    qpushd ${_TAG_WIN_REPOS_UDIR}
+      ${BUILDSERVER_DIR}/build_package.sh ${tag}
+    qpopd
   
+  fi
+
   # Successful build of one tag. We may be in a loop to build several tags.
-  # So mark this one as done to prevent it from being rebuilt if a subsequent
+  # So mark this one as done to prevent it from being restarted if a subsequent
   # build fails.
   built_tags="${built_tags}${tag_rev}"$'\n'
   echo "${built_tags}" | sort  | grep -v '^$' > ${tagfile}

commit 042af15ae565e6264464227660753ae247ef36b3
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Tue Oct 7 16:38:41 2014 +0200

    Build server: rework test to find which tags to build
    
    Less intermediate file accesses
    More robust with regards to line endings
    Don't mark a tag as built when the tag build script failed for some reason

diff --git a/buildserver/build_tags.sh b/buildserver/build_tags.sh
index c33fd61..cee4697 100644
--- a/buildserver/build_tags.sh
+++ b/buildserver/build_tags.sh
@@ -60,31 +60,35 @@ if [ ! -f ${tagfile} ] ; then
   for one_tag in $($GIT_CMD tag)
   do
     tag_hash=$($GIT_CMD rev-parse ${one_tag})
-    echo ${tag_hash}/${one_tag} >> ${tagfile}
+    echo ${one_tag}/${tag_hash} >> ${tagfile}
   done
 fi
 
 # Figure out the new set of tags
+prev_built_tags="$(cat "${tagfile}")"
+built_tags=
+tags=
 rm -f ${tagfile}.new
 for one_tag in $($GIT_CMD tag)
 do
   tag_hash=$($GIT_CMD rev-parse ${one_tag})
-  echo ${tag_hash}/${one_tag} >> ${tagfile}.new
+  if [ -n "$(grep ${one_tag}/${tag_hash} <<< "${prev_built_tags}")" ]
+  then
+      built_tags="${built_tags}${one_tag}/${tag_hash}"$'\n'
+  else
+      tags="${tags}${one_tag}/${tag_hash}"$'\n'
+  fi
 done
-tags="`diff --suppress-common-lines ${tagfile} ${tagfile}.new | grep '^> ' | sed -e 's/^> //g'`"
 qpopd
 
-# move the new file into place
-mv -f ${tagfile}.new ${tagfile}
-
 qpopd # return to directory the script was invoked from (not necessarily the directory this script resides in)
 
 ################################################################
 # Now iterate over all the new tags (if any) and build a package
 
 for tag_rev in $tags ; do
-  tag=${tag_rev#*/}
-  tag=${tag%/*}
+  tag_hash=${tag_rev#*/}
+  tag=${tag_rev%/*}
 
   # Git builds are only supported from 2.5 up
   get_major_minor $tag
@@ -133,4 +137,10 @@ for tag_rev in $tags ; do
   qpushd ${_TAG_WIN_REPOS_UDIR}
     ${BUILDSERVER_DIR}/build_package.sh ${tag}
   qpopd
+  
+  # Successful build of one tag. We may be in a loop to build several tags.
+  # So mark this one as done to prevent it from being rebuilt if a subsequent
+  # build fails.
+  built_tags="${built_tags}${tag_rev}"$'\n'
+  echo "${built_tags}" | sort  | grep -v '^$' > ${tagfile}
 done

commit f46b85cbca6e75bdfd602f7d3533086b8a6c43bf
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Tue Oct 7 14:38:28 2014 +0200

    Refactor function usage to avoid code duplication

diff --git a/buildserver/build_package.sh b/buildserver/build_package.sh
index 0168772..9054f7d 100644
--- a/buildserver/build_package.sh
+++ b/buildserver/build_package.sh
@@ -20,11 +20,9 @@ function on_error() {
   exit
 }
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
-
-. ./functions.sh
+BUILDSERVER_DIR="$(dirname "$0")"
+GC_WIN_DIR="$BUILDSERVER_DIR/.."
+. "$GC_WIN_DIR/functions.sh"
 . ./defaults.sh
 
 tag="${1:-$GNUCASH_SCM_REV}"
diff --git a/buildserver/build_periodic.sh b/buildserver/build_periodic.sh
index f503cc0..20e14fe 100644
--- a/buildserver/build_periodic.sh
+++ b/buildserver/build_periodic.sh
@@ -11,6 +11,11 @@
 #    won't allow to change a file that is "in use". So in the rare
 #    situation this script needs to be updated, you will need to
 #    run the git pull once yourself.
+#
+# 3. This script assumes it's called with a full absolute path.
+#    eg: c:\\gcdev\\gnucash-on-windows.git\\buildserver\\build_periodic.sh
+#    or  /c/gcdev/gnucash-on-windows.git/buildserver/build_periodic.sh
+#    Failing to do so will break the build.
 
 set -e
 
@@ -30,13 +35,11 @@ then
   fi
 fi
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
+BUILDSERVER_DIR="$(dirname "$0")"
+GC_WIN_DIR="$BUILDSERVER_DIR/.."
+. "$GC_WIN_DIR/functions.sh"
 
-_BUILDSERVER_UDIR="$(dirname $(unix_path "$0"))"
-qpushd "$_BUILDSERVER_UDIR/.."
-. ./functions.sh
+qpushd "$GC_WIN_DIR"
 . ./defaults.sh
 
 # Variables
@@ -69,7 +72,7 @@ newrev=$($GIT_CMD rev-parse HEAD)
 qpopd # leave gnucash repository
 
 if [[ "${oldrev}" != "${newrev}" ]]; then
-  $_BUILDSERVER_UDIR/build_package.sh
+  $BUILDSERVER_DIR/build_package.sh
 fi
 
 # move the new file into place, will only happen if the build was successful
diff --git a/buildserver/build_tags.sh b/buildserver/build_tags.sh
index bb3c8b7..c33fd61 100644
--- a/buildserver/build_tags.sh
+++ b/buildserver/build_tags.sh
@@ -11,20 +11,22 @@
 #    won't allow to change a file that is "in use". So in the rare
 #    situation this script needs to be updated, you will need to
 #    run the git pull once yourself.
+#
+# 3. This script assumes it's called with a full absolute path.
+#    eg: c:\\gcdev\\gnucash-on-windows.git\\buildserver\\build_tags.sh
+#    or  /c/gcdev/gnucash-on-windows.git/buildserver/build_tags.sh
+#    Failing to do so will break the build.
 
 set -e
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
-
 ################################################################
 # Setup our environment  (we need the DOWNLOAD_DIR)
 
-_BUILDSERVER_UDIR="$(dirname $(unix_path "$0"))"
-qpushd "$_BUILDSERVER_UDIR/.."
-pkgdir="`pwd`"
-. ./functions.sh
+BUILDSERVER_DIR="$(dirname "$0")"
+GC_WIN_DIR="$BUILDSERVER_DIR/.."
+. "$GC_WIN_DIR/functions.sh"
+
+qpushd "$GC_WIN_DIR"
 . ./defaults.sh
 
 # Variables
@@ -129,6 +131,6 @@ for tag_rev in $tags ; do
   # Now build the tag!  (this will upload it too)
   # Use the build_package script from master (cwd), not from the tag
   qpushd ${_TAG_WIN_REPOS_UDIR}
-    ${_BUILDSERVER_UDIR}/build_package.sh ${tag}
+    ${BUILDSERVER_DIR}/build_package.sh ${tag}
   qpopd
 done
diff --git a/create_cross_mingw.sh b/create_cross_mingw.sh
index 7cda3b4..1291a30 100755
--- a/create_cross_mingw.sh
+++ b/create_cross_mingw.sh
@@ -1,11 +1,9 @@
 #! /bin/bash
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
+GC_WIN_DIR="$(dirname "$0")"
+. "$GC_WIN_DIR/functions.sh"
 
-qpushd "$(dirname "$0")"
-. functions.sh
+qpushd "$GC_WIN_DIR"
 . defaults.sh
 
 #
diff --git a/crossbuild_webkit.sh b/crossbuild_webkit.sh
index e983948..a1e51dc 100755
--- a/crossbuild_webkit.sh
+++ b/crossbuild_webkit.sh
@@ -7,12 +7,10 @@ set -e
 echo -n "Build Starting at "
 date
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
+GC_WIN_DIR="$(dirname "$0")"
+. "$GC_WIN_DIR/functions.sh"
 
-qpushd "$(dirname $(unix_path "$0"))"
-. functions.sh
+qpushd "$GC_WIN_DIR"
 . defaults.sh
 
 register_env_var ACLOCAL_FLAGS " "
diff --git a/dist.sh b/dist.sh
index 61cf7ad..f2576df 100755
--- a/dist.sh
+++ b/dist.sh
@@ -11,12 +11,10 @@ trap on_error ERR
 echo -n "Build (dist) Starting at "
 date
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
+GC_WIN_DIR="$(dirname "$0")"
+. "$GC_WIN_DIR/functions.sh"
 
-qpushd "$(dirname $(unix_path "$0"))"
-. functions.sh
+qpushd "$GC_WIN_DIR"
 . defaults.sh
 . dist-impl.sh
 
diff --git a/functions.sh b/functions.sh
index c13ebc9..2e1618d 100644
--- a/functions.sh
+++ b/functions.sh
@@ -37,7 +37,10 @@ function eval_now() {
 function quiet() { "$@" &>/dev/null; }
 
 # c:/dir/sub
+function qpushd() { pushd "$@" >/dev/null; }
+function qpopd() { popd >/dev/null; }
 function win_fs_path() { echo "$*" | sed 's,\\,/,g'; }
+function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
 
 # usage:  wpwd [rel]
 # rel can be any relative path
diff --git a/install.sh b/install.sh
index 42e70dd..8a1d3fa 100644
--- a/install.sh
+++ b/install.sh
@@ -19,12 +19,10 @@ trap on_error ERR
 echo -n "Build Starting at "
 date
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
+GC_WIN_DIR="$(dirname "$0")"
+. "$GC_WIN_DIR/functions.sh"
 
-qpushd "$(dirname $(unix_path "$0"))"
-. ./functions.sh
+qpushd "$GC_WIN_DIR"
 . ./defaults.sh
 . ./install-impl.sh
 
diff --git a/make_install.sh b/make_install.sh
index cd3b79b..9c3dbaa 100644
--- a/make_install.sh
+++ b/make_install.sh
@@ -2,12 +2,10 @@
 
 set -e
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
+GC_WIN_DIR="$(dirname "$0")"
+. "$GC_WIN_DIR/functions.sh"
 
-qpushd "$(dirname $(unix_path "$0"))"
-. functions.sh
+qpushd "$GC_WIN_DIR"
 . defaults.sh
 reset_steps
 . install.sh
diff --git a/reset.sh b/reset.sh
index aea1315..86cdb36 100644
--- a/reset.sh
+++ b/reset.sh
@@ -4,12 +4,10 @@ set -e
 
 ####  Load defaults.sh
 
-function qpushd() { pushd "$@" >/dev/null; }
-function qpopd() { popd >/dev/null; }
-function unix_path() { echo "$*" | sed 's,^\([A-Za-z]\):,/\1,;s,\\,/,g'; }
+GC_WIN_DIR="$(dirname "$0")"
+. "$GC_WIN_DIR/functions.sh"
 
-qpushd "$(dirname $(unix_path "$0"))"
-. functions.sh
+qpushd "$GC_WIN_DIR"
 . defaults.sh
 
 ## too bad, bash 2.04 has no real support for arrays

commit 9d19d0c0124e9e36fa7396f1c557db56d73d27c4
Author: Geert Janssens <janssens-geert at telenet.be>
Date:   Tue Oct 7 16:37:34 2014 +0200

    Quote variable to preserve newlines

diff --git a/install-impl.sh b/install-impl.sh
index 942b90d..4e584a8 100644
--- a/install-impl.sh
+++ b/install-impl.sh
@@ -1248,7 +1248,7 @@ function inst_gnucash() {
 
     # Check for options that may not be available in all versions we can build
     _CONFIG_HELP=$($_REPOS_UDIR/configure --help)
-    if [ -n "$(grep -- '--with-boost' <<< $_CONFIG_HELP)" ]; then
+    if [ -n "$(grep -- '--with-boost' <<< "$_CONFIG_HELP")" ]; then
         _EXTRA_OPTIONS="--with-boost=${BOOST_ROOT}"
     else
         _EXTRA_OPTIONS=""



Summary of changes:
 buildserver/build_package.sh  |   8 +--
 buildserver/build_periodic.sh |  19 ++++---
 buildserver/build_tags.sh     | 129 +++++++++++++++++++++++-------------------
 create_cross_mingw.sh         |   8 +--
 crossbuild_webkit.sh          |   8 +--
 dist.sh                       |   8 +--
 functions.sh                  |  11 ++--
 install-impl.sh               |   2 +-
 install.sh                    |   8 +--
 make_install.sh               |   8 +--
 reset.sh                      |   8 +--
 11 files changed, 111 insertions(+), 106 deletions(-)



More information about the gnucash-changes mailing list