From 754e6877cccddd0a279659c32fa594b23369dc61 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 23 Oct 2017 14:57:56 +0200 Subject: fixups for recent "Cleanup jenkins build scripts" Change I24e500e132f5c8e8133d35548cb7b4e4552331d0 was merged, but IMHO needs improvement. Fix these: - clean the git source tree before each build step, in common prep_build(). - fix indenting inside the build() macros. - change build() arg to be build_dir, to absorb cleanup steps into build(). - in jenkins.sh, use $ENABLE_SANITIZE as global env, not passed as arg. - in jenkins.sh, don't do 'make distcheck' twice. It is not necessary to do it from source tree as well as separately from source tree, since distcheck already moves to a different build dir. Change-Id: I09d306350602f21943d5bd45f7388c83ede9b524 --- contrib/jenkins_common.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'contrib/jenkins_common.sh') diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index e52a96a9..6cfa3347 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -4,4 +4,20 @@ set -ex verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") -autoreconf --install --force +prep_build() { + _src_dir="$1" + _build_dir="$2" + + cd "$_src_dir" + + # a failed 'make distcheck' may leave files without write permissions + chmod -R a+w . + git clean -dxf + # make absolutely sure no src files have modifications + git checkout -f HEAD + + autoreconf --install --force + + mkdir -p "$_build_dir" + cd "$_build_dir" +} -- cgit v1.2.3