Finding the leaves in pkgsrc

Let’s say you want to identify the pkgsrc packages on your system that are ‘leaves’, meaning no other packages are dependent on them.  Johnny Lam, on the pkgsrc-users@ mailing list, has a short script to find just that.