Shell FTW!

Ha, do this with a GUI:

lsof -p $(ps ux | egrep [/]opt/local | awk '{print $2}' | xargs | sed 's/ /,/g') | fgrep opt/local | awk '{print $9}' | sort -u | xargs port provides | sed 's/.*: //' | sort -u | xargs port -f upgrade

The command line rules!

It’s meant to rebuild every MacPorts package I’ve got installed that is loaded when I start XDarwin (the xfree86 port in MacPorts) in a vague attempt to fix the completely broken mouse pointer in X.