Created
February 11, 2010 21:41
-
-
Save jayfallon/301998 to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
if test -z "$1"; then | |
echo "usage: $0 <libname>" | |
exit 1 | |
fi | |
for file in `find /opt/local/lib -name *.dylib; find /opt/local/bin`; do | |
# Skip this match if it's a symbolic link | |
if test -f $file -a ! -L $file; then | |
# Look for references to the missing library | |
otool -L $file | grep --silent $1 | |
if test "$?" = "0"; then | |
port provides `echo $file` | |
fi | |
fi | |
# Grab the name of the port and make sure to list each port just once | |
done | awk -F: ' { print $2 } ' | sort | uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment