[forgot to Cc the list]
On Mon, Jan 10, 2022 at 11:36:04AM +0100, Marc Espie wrote:
> On Sun, Jan 09, 2022 at 10:03:01PM -0500, Jeffrey Walton wrote:
> > Hi Everyone,
> >
> > I am working on OpenBSD 7.0, x86_64. I'm trying to script an install
> > of developer tools I use, like GCC and Git. When I attempt to install
> > GCC I am prompted:
> >
> > $ sudo pkg_add gcc g++
> > quirks-4.54 signed on 2022-01-09T19:08:35Z
> > Ambiguous: choose package for gcc
> > a 0: <None>
> > 1: gcc-8.4.0p9
> > 2: gcc-11.2.0p0
> >
> > I've looked over the man page at https://man.openbsd.org/pkg_add, but
> > I don't see an option to tell pkg_add to install the latest version of
> > the package.
>
> Sure there is.
>
> Quoting the manpage:
> There is also an ambiguity related to ports with multiple branches. For
> instance ‘pkg_add python’ is ambiguous, as there are several versions of
> python in the ports tree. So is ‘pkg_add postfix’. The special form
> ‘pkgname%branch’ can be used to restrict matches to a branch matching the
> pkgpath(7).
>
> pkg_add gcc%11 g++%11
> will do the trick
>