Skip to content

Instantly share code, notes, and snippets.

@bchretien
Created September 8, 2014 08:47
Show Gist options
  • Save bchretien/266d9a9925f2071bc795 to your computer and use it in GitHub Desktop.
Save bchretien/266d9a9925f2071bc795 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Find libraries (and packages) that link to a library matching a given pattern.
# First argument: library folder (e.g. /opt/ros/hydro/lib)
# Second argument: library dependency (or pattern)
for lib in $(find $1 -name \*.so) ; do
res=`ldd -v $lib | grep $2`
if [ ! -z "$res" ]; then
echo "$res"
echo "`pacman -Qo $lib`"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment