diff options
Diffstat (limited to 'tcwg-llvm-common.sh')
-rwxr-xr-x | tcwg-llvm-common.sh | 18 |
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 |