FreeBSD ports… good but a pain.

So. I wanted to install gnupg from FreeBSD ports on an older box. Somehow it depended on something that depended on the LDAP libraries. Which broke authentication on the box. And in fixing that, lots of other dependencies needed to be updated. It turned into a horrible mess and some ports wouldn’t reinstall cleanly and no amount of portupgrade/portmaster shenanigans would fix it without removing swathes of stuff first.

In trying to find out which shared libraries were now broken, I wrote a very crude script to find out which binaries broke.

In short, it finds executable files that ldd reports as having missing runtime dependencies and attempts to find those in the package directory (so you have a clue which packages it came from).

I renamed libfam to something else, just to test the script, and this was the output:

First field is the file that is broken. Second field are FreeBSD ports (packages) that contain files with that name. Last field shows the missing libraries.

If no package uses a broken binary then that field in the output stays blank, wit:

I’m posting this in case someone else finds it useful…