From ecb6987cdaad641188136297c3f9093febcb019a Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 24 Sep 2018 12:15:46 +0200 Subject: [PATCH] jenkins: ensure valid locale is set before running This prevents the dreaded "Content is not allowed in prolog" errors when running gradle. C.UTF-8 is a Debian thing that is not supported everywhere including Java. fdroid/basebox#9 --- jenkins-build-all | 5 +++++ jenkins-setup-build-environment | 5 +++++ jenkins-test | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/jenkins-build-all b/jenkins-build-all index b96145c0..9d670a35 100755 --- a/jenkins-build-all +++ b/jenkins-build-all @@ -18,6 +18,11 @@ if [ -z $WORKSPACE ]; then export WORKSPACE=`pwd` fi +if [ -z $LC_ALL ] || [ $LC_ALL == "C.UTF-8" ] || [[ $LC_ALL != *.UTF-8 ]]; then + export LC_ALL=en_US.UTF-8 + echo "Forcing locale to $LC_ALL" +fi + set -e set -x diff --git a/jenkins-setup-build-environment b/jenkins-setup-build-environment index 0cefb8d6..390f22d5 100755 --- a/jenkins-setup-build-environment +++ b/jenkins-setup-build-environment @@ -12,6 +12,11 @@ if [ -z $WORKSPACE ]; then WORKSPACE=`pwd` fi +if [ -z $LC_ALL ] || [ $LC_ALL == "C.UTF-8" ] || [[ $LC_ALL != *.UTF-8 ]]; then + export LC_ALL=en_US.UTF-8 + echo "Forcing locale to $LC_ALL" +fi + # make sure that no VirtualBox processes are left running cleanup_all() { set +e diff --git a/jenkins-test b/jenkins-test index 6af9cfd9..5f678655 100755 --- a/jenkins-test +++ b/jenkins-test @@ -17,6 +17,11 @@ if [ -z $WORKSPACE ]; then export WORKSPACE=`pwd` fi +if [ -z $LC_ALL ] || [ $LC_ALL == "C.UTF-8" ] || [[ $LC_ALL != *.UTF-8 ]]; then + export LC_ALL=en_US.UTF-8 + echo "Forcing locale to $LC_ALL" +fi + set -e set -x