From 4a7cb27899d5b1c74a68eb9d62a7cfe6cd804017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sat, 16 Mar 2019 10:53:00 +0200 Subject: [PATCH] Don't error out if git-svn is unavailable This should avoid leaving the llvm tree checked out at a version other than the pinned one, if git-svn failed or wasn't available. --- build-llvm.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build-llvm.sh b/build-llvm.sh index 0d6d2a2..588ddb7 100755 --- a/build-llvm.sh +++ b/build-llvm.sh @@ -33,13 +33,15 @@ PREFIX="$(cd "$PREFIX" && pwd)" if [ ! -d llvm ]; then # When cloning master and checking out a pinned old hash, we can't use --depth=1. - # Do the git-svn rebase to populate git-svn information, to make - # "clang --version" produce SVN based version numbers. git clone -b master https://github.com/llvm-mirror/llvm.git cd llvm/tools git clone -b master https://github.com/llvm-mirror/clang.git git clone -b master https://github.com/llvm-mirror/lld.git cd .. + set +e + # Do the git-svn rebase to populate git-svn information, to make + # "clang --version" produce SVN based version numbers. + # This is optional - don't error out here if git-svn is unavailable. git svn init https://llvm.org/svn/llvm-project/llvm/trunk git config svn-remote.svn.fetch :refs/remotes/origin/master git svn rebase -l @@ -52,6 +54,7 @@ if [ ! -d llvm ]; then git config svn-remote.svn.fetch :refs/remotes/origin/master git svn rebase -l cd ../../.. + set -e CHECKOUT=1 fi