ports tree cleanup functions

This little ZSH function helps me to clean up my ports tree. I often use this function after a big wip-update task to reinstall my standard applications.

ports_cleanup () {
	for name in `pkg_info -P -q`; do
		cd /usr/ports/${name%,*};
		make clean=all
		rm -rf /usr/ports/plist
		rm -rf /usr/ports/packages
		rm -rf /usr/ports/pobj

My experience taught me, don’t delete the distfiles make distclean unless you need storage. You’ll save so much time.