From 81715828c6a023a0e774594173244d4e8e471033 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Tue, 12 Feb 2019 09:27:42 +0000 Subject: [rr-many 2/N] Update and simplify round-robin.sh: clone_repo() With simpler meaning of rr[COMPONENT_branch] to be either "baseline" (instead of "default", overrides from ${rr[current_project]}, etc.) we only need to resolve "baseline" value. Change-Id: I5f32949587688d152402b6b64ed4a37ac062019e --- round-robin.sh | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'round-robin.sh') diff --git a/round-robin.sh b/round-robin.sh index 1fdd27de..bd3d886f 100644 --- a/round-robin.sh +++ b/round-robin.sh @@ -123,24 +123,15 @@ clone_repo () fi local branch - # Select the branch to build. - # ${rr[current_branch]} specifies branch for ${rr[current_project]}, - # and everything else uses baseline branch. - if [ x"$project" = x"${rr[current_project]}" ]; then - # Use the tip of the branch tracked in the current configuration. - if [ x"${rr[current_branch]}" = x"default" ]; then - branch=${rr[${rr[current_project]}_branch]} - elif [ x"${rr[current_branch]}" = x"baseline" ]; then - branch="refs/remotes/baseline/${rr[baseline_branch]}" - else - branch=${rr[current_branch]} - fi - elif ${rr[init_configuration]-false}; then - branch="${rr[${project}_branch]}" - else + + # Resolve "baseline" branch specifier. + if [ x"${rr[${project}_branch]}" = x"baseline" ]; then branch="refs/remotes/baseline/${rr[baseline_branch]}" + else + branch="${rr[${project}_branch]}" fi + # Allow manifest override branch="${rr[${project}_rev]-$branch}" # Decide on whether to use read-only or read-write mode for @@ -148,7 +139,7 @@ clone_repo () # developers without ssh keys on Linaro git servers to reproduce builds # in --mode "baseline". local read_only="true" - if [ x"$project" = x"${rr[current_project]}" -a \ + if [ x"${rr[${project}_branch]}" != x"baseline" -a \ x"${rr[mode]}" = x"jenkins-full" ]; then read_only=false fi -- cgit v1.2.3