Skip to content

Commit

Permalink
Only remove newly installed llvm packages and not always everything
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Oct 9, 2023
1 parent 93c633b commit 08c0173
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion features/src/llvm/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 08c0173

Please sign in to comment.