Skip to content

Instantly share code, notes, and snippets.

@f99aq8ove
Created May 2, 2012 11:26
Show Gist options
  • Save f99aq8ove/2575958 to your computer and use it in GitHub Desktop.
Save f99aq8ove/2575958 to your computer and use it in GitHub Desktop.
Find out unused compat libraries for FreeBSD.
#!/bin/sh -e
ldd_list=$(mktemp -t lddlist)
if [ $? = 0 ]; then
trap "rm -f '$ldd_list'" EXIT
fi
set +e
ldd /usr/local/bin/* /usr/local/lib/*.so* > "$ldd_list" 2> /dev/null
set -e
for i in /usr/local/lib/compat/pkg/*; do
if ! grep "$i" "$ldd_list" > /dev/null; then
echo "$i"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment