Related to bug 228226 it seem pkg_cutleaves will exclude anything that doesn't match the following regex:
I believe this is trying to match portname-version.
The g was added to support github versioning gYYYYMMDD. It appears there's a number of other ports that have "interesting" versioning schemes. ex: universal-ctags: p5.9.20210815.0. Changing the above regex to [gp] would fix it at least for this package's scheme. However, that leaves ~100 oddly versioned packages left.
Looking at the output of:
pkg rquery -r FreeBSD -a '%v %o' | grep -v "^[0-9g]"
You can see others that I would assume wouldn't be added to the exclude list.
Should the above regex allow at least the first couple characters after the - to be non-digits?
Is it possible for $leavestokeep array to use $name instead of $file? If so the regex wouldn't be required at all?