@@ -228,14 +228,21 @@ printf "%s\n" \
228228 "Acquire::AllowWeakRepositories \" true\" ;" \
229229 | tee /etc/apt/apt.conf.d/99llvm-allow-weak
230230
231- # Add LLVM repository for versions above 20 because it is not available in the default repo
232- if [[ "${CLANG_VERSION}" -gt 20 ]]; then
231+ if [[ "${CLANG_VERSION}" -eq 21 ]]; then
233232 apt-get update
233+ # Add LLVM repository for versions above 20 because it is not available in the default repo
234234 apt-get install -y --no-install-recommends lsb-release software-properties-common gnupg
235235 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
236236 DISTRO_CODENAME=$(lsb_release -cs)
237237 echo "deb http://apt.llvm.org/${DISTRO_CODENAME}/ llvm-toolchain-${DISTRO_CODENAME}-${CLANG_VERSION} main" \
238238 | tee /etc/apt/sources.list.d/llvm.list
239+ apt-get update
240+ apt-get install -y --no-install-recommends --allow-unauthenticated \
241+ clang-tidy-${CLANG_VERSION}
242+ update-alternatives \
243+ --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} 100
244+ update-alternatives \
245+ --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-${CLANG_VERSION} 100
239246 apt-get clean
240247 rm -rf /var/lib/apt/lists/*
241248fi
@@ -245,7 +252,6 @@ apt-get install -y --no-install-recommends --allow-unauthenticated \
245252 clang-${CLANG_VERSION} \
246253 libclang-rt-${CLANG_VERSION}-dev \
247254 llvm-${CLANG_VERSION} \
248- clang-tidy-${CLANG_VERSION} \
249255 gcc \
250256 g++
251257apt-get clean
@@ -259,10 +265,6 @@ update-alternatives \
259265 --slave /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION}
260266update-alternatives \
261267 --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-${CLANG_VERSION} 100
262- update-alternatives \
263- --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-${CLANG_VERSION} 100
264- update-alternatives \
265- --install /usr/bin/run-clang-tidy run-clang-tidy /usr/bin/run-clang-tidy-${CLANG_VERSION} 100
266268update-alternatives --auto cc
267269update-alternatives --auto c++
268270update-alternatives --auto clang
0 commit comments