diff options
author | Renato Golin <renato.golin@linaro.org> | 2017-05-25 15:06:44 +0100 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2017-05-26 12:55:01 +0000 |
commit | 7365a8ab05c211ee916a364db1e035fbcfffffae (patch) | |
tree | 5cf4b211f2bf55e39a2443a875df98bad566ccab /tcwg-llvm-common.sh | |
parent | ce08cedbcb70ef3f51bd5a0dd548680312e146c6 (diff) |
tcwg-llvm-build.sh: Add list of projects to consider
As discussed in TCWG-1134, we need a list of projects to checkout if the
branch is master and there is a revision (buildbot and pre-commit base
cases) as well as a branch and no list (for pre-commit patch cases.
The relationship between lists and branches is that having a branch and
not being in the list is ok, but being in the list and not having a
branch is not. This patch addresses that, so that we can create any
number of trigger jobs without worrying about the parameters we pass.
It should either be safe, user error, or the job will bail.
Needs https://review.linaro.org/19777 to work.
Change-Id: I83fa889f3d3ebf80f08ffed218d4e72e40a88ecc
Diffstat (limited to 'tcwg-llvm-common.sh')
-rwxr-xr-x | tcwg-llvm-common.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tcwg-llvm-common.sh b/tcwg-llvm-common.sh index 180faa88..c7139b73 100755 --- a/tcwg-llvm-common.sh +++ b/tcwg-llvm-common.sh @@ -100,7 +100,7 @@ find_svn_rev() { # Find the largest revision of a list find_last_rev() { local LAST=0 - for rev in "$@"; do + for rev in $@; do [ "$rev" -gt "$LAST" ] && LAST=$rev done echo "$LAST" @@ -118,6 +118,18 @@ has_remote_branch() { fi } +# Find element in array +is_in_list() { + local ITEM="$1" + shift + for item in $@; do + if [ "$ITEM" = "$item" ]; then + return 0 + fi + done + return 1 +} + # Environment Variables and default values CPUS=$(nproc --all) # We may use between 500MB and 1GB per link job |