diff options
author | Renato Golin <renato.golin@linaro.org> | 2017-05-15 10:19:05 +0100 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2017-05-15 10:26:57 +0100 |
commit | d9fe7fb99336426171f5717a51e8b63a26431cf0 (patch) | |
tree | db0f6604a1164aae81f2056ec67bae91aa580d5f | |
parent | 9059e1f0b5b5f752d6ab9ae6a4ef19e841f4fc33 (diff) |
tcwg-llvm-staged-build.yaml: Add repo/branch option
Change-Id: Ie81de5b7ce4e87331a4602b7e6deada91a273942
-rwxr-xr-x | tcwg-llvm-build.sh | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/tcwg-llvm-build.sh b/tcwg-llvm-build.sh index aae9b739..5f3be0c7 100755 --- a/tcwg-llvm-build.sh +++ b/tcwg-llvm-build.sh @@ -21,7 +21,9 @@ SYN_TOOLCHAIN="--toolchain=http://url/for/tarball" SYN_BUILDID="--buildid=<text-to-add-to-tarball>" SYN_TOOLCHAIN_FILE="--toolchain-file=<file-name> (file name to copy the produced toolchain file name)" SYN_COMPILER="--compiler=clang|gcc" -SYNTAX="$0 $SYN_WORKSPACE $SYN_REVISION $SYN_ASSERTS $SYN_LINKJOBS $SYN_BUILDJOBS $SYN_TOOLCHAIN $SYN_BUILDID $SYN_TOOLCHAIN_FILE $SYN_COMPILER" +SYN_REPOSITORY="--repository=http://url/for/git/repo/" +SYN_BRANCH="--branch=branchname" +SYNTAX="$0 $SYN_WORKSPACE $SYN_REVISION $SYN_ASSERTS $SYN_LINKJOBS $SYN_BUILDJOBS $SYN_TOOLCHAIN $SYN_BUILDID $SYN_TOOLCHAIN_FILE $SYN_COMPILER $SYN_REPOSITORY $SYN_BRANCH" # Environment Variables and default values WORKSPACE=$(pwd) @@ -35,6 +37,8 @@ BUILDJOBS=$CPUS TOOLCHAIN="" TOOLCHAIN_FILE="" BUILDID="" +REPOSITORY="https://llvm.org/git/llvm.git" +BRANCH="master" # Command line parsing while [ "$#" -gt 0 ]; do @@ -98,7 +102,7 @@ while [ "$#" -gt 0 ]; do fi shift ;; --linkjobs) - if [ "$VAL" -gt 0 ]; then + if [ ! -z "$VAL" ]; then LINKJOBS="$VAL" else echo "ERROR: Link jobs '$VAL' not valid" @@ -106,6 +110,24 @@ while [ "$#" -gt 0 ]; do exit 1 fi shift ;; + --repository) + if [ ! -z "$VAL" ]; then + REPOSITORY="$VAL" + else + echo "ERROR: Git repository '$VAL' not valid" + echo "Syntax: $SYN_REPOSITORY" + exit 1 + fi + shift ;; + --branch) + if [ "$VAL" -gt 0 ]; then + BRANCH="$VAL" + else + echo "ERROR: Git branch '$VAL' not valid" + echo "Syntax: $SYN_BRANCH" + exit 1 + fi + shift ;; --toolchain) download_toolchain "$WORKSPACE" "$VAL" shift ;; @@ -178,10 +200,10 @@ LOGEXT="txt" # Checkout { flock -s 9 - git clone http://llvm.org/git/llvm.git \ + git clone -b "$BRANCH" "$REPOSITORY/llvm.git" \ --reference "$REFDIR/llvm" \ "$SRCDIR" |& tee "$LOGBASE-clone.$LOGEXT" - git clone http://llvm.org/git/clang.git \ + git clone -b "$BRANCH" "$REPOSITORY/clang.git" \ --reference "$REFDIR/clang" \ "$SRCDIR/tools/clang" |& tee -a "$LOGBASE-clone.$LOGEXT" } 9>"$REFDIR.lock" |