+++ This bug was initially created as a clone of Bug #245462 +++
pkg 1.15.4 had essentially the same bug as bug 245642 reappear, after some other work on the code involved. I've fixed it, hopefully for good, in https://github.com/freebsd/pkg/pull/1893
It's already been accepted as commits at
The fix will be available in pkg 1.16.
(In reply to cgull from comment #0)
1.16 released, closing this one ;)