Skip to content

Instantly share code, notes, and snippets.

@rindeal
Created October 21, 2016 23:51
Show Gist options
  • Save rindeal/0116a402514b0d5f02b8f7aaa64df444 to your computer and use it in GitHub Desktop.
Save rindeal/0116a402514b0d5f02b8f7aaa64df444 to your computer and use it in GitHub Desktop.
libstdc++_upgrade_packages.sh
#!/bin/bash -
# CREATED: 9.8.2015 01:04
set -o nounset # Treat unset variables as an error
IFS=: read -ra pathComponents <<<"$PATH"
while IFS= read -rd '' x; do
ldd -r -- "$x" | grep -q libstdc++ && bins+=("$x")
done < <(find "${pathComponents[@]}" -type f -executable -print0)
typeset -A pkgs
while read -r x; do
: ${x:+"${pkgs[${x}]=}"}
done < <(equery -q b -n "${bins[@]}")
emerge -av1 "${!pkgs[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment