gnucash-on-windows master: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Sat Aug 24 02:15:46 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash-on-windows/commit/dc4fb89d (commit)
	 via  https://github.com/Gnucash/gnucash-on-windows/commit/f894a257 (commit)
	 via  https://github.com/Gnucash/gnucash-on-windows/commit/e826d823 (commit)
	from  https://github.com/Gnucash/gnucash-on-windows/commit/03242a92 (commit)



commit dc4fb89ddb579a2c2540eb3a90deb89d19e7a5c0
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Aug 23 19:03:02 2019 +0200

    Explicitly use ssh for rsync communication

diff --git a/buildserver/build_package.ps1 b/buildserver/build_package.ps1
index 8939fce..ae8d1b2 100644
--- a/buildserver/build_package.ps1
+++ b/buildserver/build_package.ps1
@@ -144,6 +144,6 @@ bash-command -command "echo Build Ended $time_stamp >> $log_unix"
 if ($hostname) {
     bash-command -command "$script_unix/buildserver/upload_build_log.sh $log_unix $hostname $log_dir $branch"
     if ($new_file) {
-	bash-command -command "rsync -a $setup_file $hostname/$branch"
+	bash-command -command "rsync -e ssh -a $setup_file $hostname/$branch"
     }
 }
diff --git a/buildserver/upload_build_log.sh b/buildserver/upload_build_log.sh
index 78ff21d..b8246e8 100755
--- a/buildserver/upload_build_log.sh
+++ b/buildserver/upload_build_log.sh
@@ -23,7 +23,7 @@ function create_remote_dir()
         # For this hack $base_dir is just an arbitrary existing directory
         # It doesn't matter which one
         # No files will be copied from it anyway because of the exclude parameter
-        rsync -a --exclude='*' "$base_dir"/ "$1"
+        rsync -e ssh -a --exclude='*' "$base_dir"/ "$1"
     fi
 }
 
@@ -37,7 +37,7 @@ then
         # the final remote directory to store it
         # So let's just store it in the top-level so we have a trace
         # of the build start or very early failures
-        rsync -a "$log_file" "$host"/build-logs
+        rsync -e ssh -a "$log_file" "$host"/build-logs
     else
         # Now the subdirectory to store the log file is is known
         # In addition group per month to simplify navigation even more
@@ -46,14 +46,14 @@ then
         create_remote_dir "$host"/build-logs/$remote_branch_dir
         create_remote_dir "$host"/build-logs/$remote_branch_dir/$month_part
 
-        rsync -a "$log_file" "$host"/build-logs/$remote_branch_dir/$month_part
+        rsync -e ssh -a "$log_file" "$host"/build-logs/$remote_branch_dir/$month_part
 
         # Finally remove the initially start build log uploaded earlier
         # Disable fatal error handling though to prevent the complete script from exiting
         # if no early build log exists
         echo "Removing initial startup build log uploaded earlier"
         set +ex
-        rsync -rv --delete --include="$(basename $log_file)" --exclude='*' "$base_dir"/ "$host"/build-logs/
+        rsync -e ssh -rv --delete --include="$(basename $log_file)" --exclude='*' "$base_dir"/ "$host"/build-logs/
         set -ex
     fi
 fi

commit f894a2572d73a03334b843d5647a0ccb86dcb083
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Aug 22 14:03:11 2019 +0200

    Fully switch to rsync for uploading files

diff --git a/README.md b/README.md
index a850fe7..d1a2f8f 100644
--- a/README.md
+++ b/README.md
@@ -83,7 +83,7 @@ This repository includes a script, ```buildserver\build_package.ps1``` that comb
 ### build_package.ps1 options
 * **-branch**: ```maint```, ```master```, or ```release```. The last builds the release configured in gnucash.modules from the release tarball.
 * **-target_dir**: The **target_dir** configured into ```setup-mingw64.ps1```.
-* **-hostname**: The upload URI. Optional. If set the script will attempt to scp the gnucash-xxx-setup.exe and the build log to hard-coded subdirectories under this URI. The user running the script must have correctly configured ssh to connect to the URI with a key; there's no provision for password authentication.
+* **-hostname**: The upload URI. Optional. If set the script will attempt to rsync the gnucash-xxx-setup.exe and the build log to hard-coded subdirectories under this URI. The user running the script must have correctly configured ssh to connect to the URI with a key; there's no provision for password authentication.
 
 ## Other files:
 * ```jhbuildrc.in``` Template jhbuild configuration file, converted to ```jhbuildrc``` by ```setup-mingw64.ps1``` with the **target_dir**.
@@ -91,4 +91,4 @@ This repository includes a script, ```buildserver\build_package.ps1``` that comb
 * ```inno_setup/```: Configuration and localization files for building ```gnucash-xxx-setup.exe``` with Inno Setup.
 * ```patches/```: Modifications to the source packages required to build in this environment.
 * ```extra_dist/```: The Online Quote Installation tool.
-* ```exetype.pl```: A perl script for converting the executable type of programs between Windowed and Console. It is sometimes useful to convert the GnuCash executable to Console type (it's built as Windowed) to capture some text output it emits before logging starts.
\ No newline at end of file
+* ```exetype.pl```: A perl script for converting the executable type of programs between Windowed and Console. It is sometimes useful to convert the GnuCash executable to Console type (it's built as Windowed) to capture some text output it emits before logging starts.
diff --git a/buildserver/build_package.ps1 b/buildserver/build_package.ps1
index 4c85a10..8939fce 100644
--- a/buildserver/build_package.ps1
+++ b/buildserver/build_package.ps1
@@ -144,6 +144,6 @@ bash-command -command "echo Build Ended $time_stamp >> $log_unix"
 if ($hostname) {
     bash-command -command "$script_unix/buildserver/upload_build_log.sh $log_unix $hostname $log_dir $branch"
     if ($new_file) {
-	bash-command -command "scp -p $setup_file $hostname/$branch"
+	bash-command -command "rsync -a $setup_file $hostname/$branch"
     }
 }

commit e826d82372b561cf1be3ec01699a6b0a7b9952e4
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu Aug 22 10:58:33 2019 +0200

    Store build logs in subdirectories per branch and per month
    
    Note this update requires an additional msys package to be installed (rsync2)
    so you may have to re-run setup-mingw64.ps1 once before
    starting buildserver/build_package.ps1.

diff --git a/buildserver/build_package.ps1 b/buildserver/build_package.ps1
index 2b462d3..4c85a10 100644
--- a/buildserver/build_package.ps1
+++ b/buildserver/build_package.ps1
@@ -99,7 +99,7 @@ bash-command -command "cd $script_unix && git pull"
 bash-command -command "echo Build Started $time_stamp > $log_unix"
 #copy the file to the download server so that everyone can see we've started
 if ($hostname) {
-    bash-command -command "scp -p $log_unix $hostname/$log_dir/"
+    bash-command -command "$script_unix/buildserver/upload_build_log.sh $log_unix $hostname $log_dir $branch"
 }
 
 # Update MinGW-w64
@@ -142,7 +142,7 @@ bash-command -command "echo Build Ended $time_stamp >> $log_unix"
 
 # Copy the transcript and installer to the download server and delete them.
 if ($hostname) {
-	bash-command -command "scp -p $log_unix $hostname/$log_dir/"
+    bash-command -command "$script_unix/buildserver/upload_build_log.sh $log_unix $hostname $log_dir $branch"
     if ($new_file) {
 	bash-command -command "scp -p $setup_file $hostname/$branch"
     }
diff --git a/buildserver/upload_build_log.sh b/buildserver/upload_build_log.sh
new file mode 100755
index 0000000..78ff21d
--- /dev/null
+++ b/buildserver/upload_build_log.sh
@@ -0,0 +1,59 @@
+#! /bin/bash
+#
+# A function to upload build logs
+# If a branch is known it will upload to
+# build-logs/branch/yyyy-mm/logfile
+# otherwise it will upload to
+# build-logs/logfile
+
+log_file=$1
+host=$2
+log_dir=$3
+remote_branch_dir=$4
+base_dir=$(pwd) # A dummy base directory used in rsync
+
+# This function will create a remote directory
+# It will only run if $host is configured.
+# Note it assumes the parent directory exists and it won't
+# create intermediate subdirectories if that is not the case
+function create_remote_dir()
+{
+    if [[ -n "$host" ]]
+    then
+        # For this hack $base_dir is just an arbitrary existing directory
+        # It doesn't matter which one
+        # No files will be copied from it anyway because of the exclude parameter
+        rsync -a --exclude='*' "$base_dir"/ "$1"
+    fi
+}
+
+if [[ -n "$host" ]]
+then
+    echo "Uploading log file '$(basename $log_file)'"
+    create_remote_dir "$host"/build-logs
+    if [[ -z "$remote_branch_dir" ]]
+    then
+        # We don't know the build type yet, so we can't determine
+        # the final remote directory to store it
+        # So let's just store it in the top-level so we have a trace
+        # of the build start or very early failures
+        rsync -a "$log_file" "$host"/build-logs
+    else
+        # Now the subdirectory to store the log file is is known
+        # In addition group per month to simplify navigation even more
+        month_part=$(date +%Y-%m)
+
+        create_remote_dir "$host"/build-logs/$remote_branch_dir
+        create_remote_dir "$host"/build-logs/$remote_branch_dir/$month_part
+
+        rsync -a "$log_file" "$host"/build-logs/$remote_branch_dir/$month_part
+
+        # Finally remove the initially start build log uploaded earlier
+        # Disable fatal error handling though to prevent the complete script from exiting
+        # if no early build log exists
+        echo "Removing initial startup build log uploaded earlier"
+        set +ex
+        rsync -rv --delete --include="$(basename $log_file)" --exclude='*' "$base_dir"/ "$host"/build-logs/
+        set -ex
+    fi
+fi
diff --git a/setup-mingw64.ps1 b/setup-mingw64.ps1
index 2b2b72a..2851ff3 100644
--- a/setup-mingw64.ps1
+++ b/setup-mingw64.ps1
@@ -234,7 +234,7 @@ bash-command -command "pacman -Syyuu --noconfirm"
 
 # Set up aliases for the parts of msys-devtools and mingw-w64-toolchain that
 # we need:
-$devel = "asciidoc autoconf autoconf2.13 autogen automake-wrapper automake1.10 automake1.11 automake1.12 automake1.13 automake1.14 automake1.15 automake1.6 automake1.7 automake1.8 automake1.9 bison diffstat diffutils dos2unix file flex gawk gettext gettext-devel gperf grep groff intltool libtool m4 make man-db pacman pactoys-git patch patchutils perl pkg-config sed swig texinfo texinfo-tex wget xmlto git jhbuild-git texinfo"
+$devel = "asciidoc autoconf autoconf2.13 autogen automake-wrapper automake1.10 automake1.11 automake1.12 automake1.13 automake1.14 automake1.15 automake1.6 automake1.7 automake1.8 automake1.9 bison diffstat diffutils dos2unix file flex gawk gettext gettext-devel gperf grep groff intltool libtool m4 make man-db pacman pactoys-git patch patchutils perl pkg-config rsync2 sed swig texinfo texinfo-tex wget xmlto git jhbuild-git texinfo"
 
 $toolchain = "binutils cmake crt-git gcc gcc-libs gdb headers-git libmangle-git libtool libwinpthread-git make pkg-config tools-git winpthreads-git"
 



Summary of changes:
 README.md                       |  4 +--
 buildserver/build_package.ps1   |  6 ++---
 buildserver/upload_build_log.sh | 59 +++++++++++++++++++++++++++++++++++++++++
 setup-mingw64.ps1               |  2 +-
 4 files changed, 65 insertions(+), 6 deletions(-)
 create mode 100755 buildserver/upload_build_log.sh



More information about the gnucash-changes mailing list