summaryrefslogtreecommitdiff
path: root/tcwg-llvm-common.sh
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2017-05-05 18:58:55 +0100
committerRenato Golin <renato.golin@linaro.org>2017-05-08 18:28:01 +0100
commit22259b91409bac424d562ac7519bf70d34df0996 (patch)
treeb260cd8f284a8948eb9a645de7c705317b627d3b /tcwg-llvm-common.sh
parent1f4988986deb6742189aa180609ab474cfc4612e (diff)
tcwg-llvm-*: Always use build ID and rev to identify builds
To make sure stage two builds the same revision as stage 1 and to correctly identify the SVN revision of an LLVM build, calculate the SVN revision if one it not provided. Always passing down toolchain and revision, as they should always be available at that point. The test-suite job is free to ignore it. Change-Id: I5a79284ac4fbc5a42e5d85e69f39a8c6d68e0cc6
Diffstat (limited to 'tcwg-llvm-common.sh')
-rwxr-xr-xtcwg-llvm-common.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tcwg-llvm-common.sh b/tcwg-llvm-common.sh
index d202bb83..4a431180 100755
--- a/tcwg-llvm-common.sh
+++ b/tcwg-llvm-common.sh
@@ -53,6 +53,8 @@ download_toolchain() {
update_git() {
local BASE=$1
local REV=$2
+ local BASEDIR
+ BASEDIR=$(dirname "$(readlink -f "$0")")
pushd "$BASE"
hash=$("$BASEDIR/svn-git-hash.pl" "$REV" | awk '{print $2}')
@@ -63,6 +65,22 @@ update_git() {
popd
}
+# Find the SVN revision of a git-svn repository
+find_svn_rev() {
+ local BASE=$1
+ rev="$(git -C "$BASE" log -n 1 | grep git-svn-id | perl -pe "s/.*@(\d+)\s.*/\$1/")"
+ echo "$rev"
+}
+
+# Find the largest revision of a list
+find_last_rev() {
+ local LAST=0
+ for rev in "$@"; do
+ [ "$rev" -gt "$LAST" ] && LAST=$rev
+ done
+ echo "$LAST"
+}
+
# Environment Variables and default values
CPUS=$(nproc --all)
# We may use between 500MB and 1GB per link job