From 811ec15ec017401f6e0e1916b765dcf96d3c50e1 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Mon, 9 Oct 2023 21:50:55 +0200 Subject: [PATCH] Only remove newly installed llvm packages and not always everything --- features/src/llvm/install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/features/src/llvm/install.sh b/features/src/llvm/install.sh index 7e5c45f70..e7eb8f28f 100755 --- a/features/src/llvm/install.sh +++ b/features/src/llvm/install.sh @@ -41,7 +41,14 @@ echo "Installing llvm-${LLVM_VERSION} compilers and tools"; ./llvm.sh $LLVM_VERSION ${PACKAGES:-all}; # Remove existing, install, and set default clang/llvm alternatives -for x in clang clangd clang++ clang-format clang-tidy lldb llvm-config llvm-cov; do +if [[ -z "$PACKAGES" \ + || "$PACKAGES" == "all" +]]; then + INSTALLED_PACKAGES=(clang clangd clang++ clang-format clang-tidy lldb llvm-config llvm-cov); +else + INSTALLED_PACKAGES=${PACKAGES}; +fi +for x in ${INSTALLED_PACKAGES[@]} do if type ${x}-${LLVM_VERSION} >/dev/null 2>&1; then (update-alternatives --remove-all ${x} >/dev/null 2>&1 || true); (update-alternatives --install /usr/bin/${x} ${x} $(which ${x}-${LLVM_VERSION}) 30);