Re: Which repo will pkg(8) select?

From: Baptiste Daroussin <bapt_at_freebsd.org>
Date: Thu, 10 Nov 2022 17:13:53 UTC
On Fri, Nov 11, 2022 at 04:11:18AM +1100, Ian Smith wrote:
> Hi crew,
> 
> is there any way to have pkg reveal which repository it will select with the present configuration, without it having to actually connect with that repo?
> 
> Specifically, bsdconfig(8) needs to know which /var/db/pkg/${something}.sqlite to check, where $something may be repo-FreeBSD or repo-FreeBSD_install_cdrom or some custom repo, likely from the default /etc/pkg/FreeBSD.conf or from (e.g) /usr/local/etc/pkg/repos/FreeBSD_install_cdrom.conf or other, or an overriding REPOS_DIR setting.
> 
> I'd sooner not have to scan each of the $REPOS_DIR directories and then parse all *.conf files, emulating pkg(8)'s described selection algorithm, but I've found no suitable option in pkg-*(8) so far.
> 
> Thanks, Ian

pkg -vv should provide you the information you are looking for.

Best regards,
Bapr