Created
February 22, 2015 12:28
-
-
Save sbeyer/d938fe616220885b034a to your computer and use it in GitHub Desktop.
Install Debian alternatives for clang/llvm 3.7 stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Debian defaults clang/llvm to use 3.5 although 3.7 is available. | |
# For example, llvm-symbolizer is used by default, e.g., | |
# if you use the address sanitizing feature of clang. | |
# The problem is that even if you use clang-3.7, it looks for | |
# llvm-symbolizer instead of llvm-symbolizer-3.7. | |
# A bug in packaging? Maybe. I don't know. I don't care. | |
# This simple script generates corresponding alternatives. | |
CLANG_VERSION=3.7 | |
for file in /usr/bin/*-$CLANG_VERSION | |
do | |
newfile="$(echo "$file" | sed 's/-'$CLANG_VERSION'$//')" | |
update-alternatives --install "$newfile" "$(basename "$newfile")" "$file" 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know that the script generates an alternative for any binary with -3.7 suffix in /usr/bin and not only clang. But... well... It suffices for me.