Using poudriere to build FreeBSD packages

A bug present in poudriere 3.0.4 (the version in my current ports tree) meant that when distfiles weren’t already present, DISTFILES_CACHE was being ignored in favour of /portdistfiles/ as the location to store downloaded distfiles, so they were never found. This caused a bit of a race condition since I was planning to use poudriere to upgrade everything before updating the main ports tree… but I handled this issue by using a separate ports tree. I’ve installed poudriere 3.0.16 and that bug is gone.

I use custom ports options for different build runs, so I’ve written a script to extract and store those options in poudriere’s desired location:

Poudriere easily maintains separate ports trees, so scheduling regular updates is safe.
# cp -Rp /usr/local/poudriere/ports/default /usr/local/poudriere/ports/`date +%Y%m%d`
# /usr/local/bin/poudriere ports -u default

I’m now running nightly builds, and flushing out packages no longer needed, as well as those that need some attention to work how I need.
# poudriere bulk -c -p default -j 84amd64 -f /my/list/of/ports