On Mon, Jan 10, 2022 at 10:54:22AM -0500, Ian Darwin wrote:
> > > > 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

> In the context of the original post, I think he meant a way to invoke 
> "pkg_add" and have
> it just install whatever the latest is, without having to know a priori that 
> there is a version 11.
> "Just install gcc, dammit". There are many ports that have version choices 
> and in the context
> of installing the latest of everything in a "scripted install", having to 
> either stop mid-install
> and answer such a prompt, or sort out in advance what ports exist in multiple 
> versions,
> is not what's wanted. It may be unwise, but it's what some people that do 
> scripted installs want.
> I have wished for this too, but it never bothered me enough to send a query. 
> :-)

For production (and thus automated installs) you do not want the latest.

We have branches.... and they should be used for that.

Granted, the gcc port naming is probably not the best ever.

But... what's your arch ? do you *really* want a gcc 11 that might not work
at all on your arch.


Sorry.   There is a lot more going on.   We could have further annotations
to let scripts decide between "most stable", "best esr", "most likely
to win a beauty contest"

Reply via email to