Re: How do I determine the ABI string used by pkg?

From: Ian Smith <smithi_at_nimnet.asn.au>
Date: Wed, 08 Mar 2023 04:47:47 UTC
On 8 March 2023 11:35:51 am AEDT, Mel Pilgrim <list_freebsd@bluerosetech.com> wrote:
 > On 2023-03-05 9:36, Ian Smith wrote:
 > > On 6 March 2023 3:03:23 am AEDT, Dan Langille <dan@langille.org>
 > wrote:
 > >   > Ian Smith wrote on 3/5/23 12:09 AM:
 > >   > > On 2 March 2023 6:50:13 pm AEDT, Mel Pilgrim
 > >   > <list_freebsd@bluerosetech.com> wrote:
 > > 
 > >   > >   > I need to determine the ABI string pkg uses on a given
 > system,
 > >   > and
 > >   > >   > need to do so when there are no pkgs installed.
 > >   > >
 > >   > >   # pkg -N -vv | grep ABI
 > > 
 > >   > Will that install pkg "when there are no pkgs installed", the
 > key
 > >   > requirement of the question?
 > > 
 > > No; using 'pkg -N' when no packages are installed, /usr/sbin/pkg
 > won't attempt to bootstrap (i.e. install pkg*.pkg as
 > /usr/local/sbin/pkg) but -vv still prints, here:
 > > 
 > > ABI = "FreeBSD:12:amd64";
 > > ALTABI = "FreeBSD:12:x86:64";
 > > 
 > > cheers, Ian  (ports@ removed from ccs)

 > On a fresh jail with just base installed:
 > 
 > # which pkg
 > /usr/sbin/pkg
 > # pkg config ABI
 > The package management tool is not yet installed on your system.
 > Do you want to fetch and install it now? [y/N]:
 > # pkg -N
 > pkg: pkg is not installed
 > # pkg -N -vv
 > pkg: pkg is not installed
 > 
 > The functionality you, Dan, et al are quoting is only available after
 > bootstraping pkg.  Yes, once it's bootstrapped getting the ABI string
 > is easy.
 > 
 > Maybe "when there are no pkgs installed" wasn't clear?

It was clear to me Mel, and I assumed you had some reason to not install pkg.

But I was mistaken believing that -N -vv should still print values from pkg.conf.

For me, this comes from getting bsdconfig(8) packages working to install packages from dvd1when not online, but I clearly don't yet grok it completely.

See /usr/share/bsdconfig/packages/musthavepkg.subr ( with patched ASSUME_ALWAYS_YES=YES )

cheers, Ian