Skip to main content
  1. Posts/

ports tree cleanup functions

·71 words·1 min· loading · loading ·
Rafael Sadowski
Author
Rafael Sadowski
Shut up and hack

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
	done
}

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