Skip to content

Instantly share code, notes, and snippets.

@barthalion
Last active December 28, 2015 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barthalion/38983425fe31836ec3e0 to your computer and use it in GitHub Desktop.
Save barthalion/38983425fe31836ec3e0 to your computer and use it in GitHub Desktop.
#!/bin/bash
cxx_packages() {
while read pkg; do
mapfile -t files < <(pacman -Qlq $pkg | grep -v /$)
grep -Fq libstdc++.so.6 "${files[@]}" <&- 2>/dev/null && echo $pkg
done < <(pacman -Qmq)
}
while read pkg; do
mapfile -t files < <(pacman -Qlq $pkg | grep -v /$ | grep -E '\.so$|^/usr/bin')
for file in ${files[@]}; do
mimetype="$(file -i $file | cut -d' ' -f2)"
case $mimetype in
'text/plain;'|'text/x-shellscript;')
continue ;;
esac
if ! grep -q cxx11 $file; then
echo "${pkg}: $file (${mimetype/;})"
fi
done
done < <(cxx_packages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment