Moving REPODIR out of /usr/obj, but sharing it between worktrees?

From: Alan Somers <asomers_at_freebsd.org>
Date: Sat, 23 May 2026 00:03:16 UTC
I'd like to snapshot my repo directories after I build each batch of
packages.  But by default, REPODIR is defined as ${OBJROOT}repo .
That puts it adjacent to the amd64.amd64 directory, which contains
object files.  So even if I make /usr/obj be its own dataset, I'll
still be wasting lots of storage space snapshotting
frequently-changing object files.

To forestall that problem, I can define REPODIR somewhere else in
/etc/src-env.conf , for example, /usr/repos.  But if I have two
worktrees, one for releng/15.0 and one for releng/15.1, then both
worktrees' repos will live in the same path.  So I can't have separate
package directories for each minor OS release.

How can I defined REPODIR in a way that allows me to separate my
packages from my objects, and also keep multiple worktrees?

Another problem is that when you do "make update-packages", even if a
package doesn't change it gets copied to a new file.  Probably the
"cp" in Makefile.inc1 in real-update-packages can be replaced by "ln",
but I haven't tested that.