Skip to content

Instantly share code, notes, and snippets.

@vegertar
Created March 3, 2023 02:50
Show Gist options
  • Save vegertar/f22392e5932bffb81b5f584533dce3f7 to your computer and use it in GitHub Desktop.
Save vegertar/f22392e5932bffb81b5f584533dce3f7 to your computer and use it in GitHub Desktop.
Choose a default clang from multiple versions in DragonFlyBSD
#!/bin/sh
basedir=`dirname $0`
version=${1:-14}
dirname=/usr/local/bin/
run() {
echo $@
$@
}
for item in `pkg info -l llvm${version} | grep "${dirname}.*${version}$"`; do
a=${item##$dirname}
b=${a%$version}
run ln -sf $item ${basedir}/${b}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment