On Sun, Jul 03, 2016 at 07:17:55PM +0800, Tinker wrote:
> At least on 5.8, neither -z nor -I do it, and those are the only arguments
> that give any hint of containing such a feature
> (http://man.openbsd.org/OpenBSD-current/man1/pkg_add.1).
> 
> Is this feature supposed to be included in "pkg_add" or is a user(me)
> refered to implement some own script?
> 
> Sometimes you just want a package and don't care about which version it is.
> 
> Thanks!
> 
> 
> 
> # pkg_add -z squid
> quirks-2.114 signed on 2015-08-09T11:57:52Z
> Ambiguous: choose package for squid
> a       0: <None>
>         1: squid-3.4.13p0
>         2: squid-3.5.6
> Your choice:
> 
> 
> # pkg_add -I squid
> quirks-2.114 signed on 2015-08-09T11:57:52Z
> Ambiguous: squid could be squid-3.4.13p0 squid-3.5.6
> 
> 
> # pkg_add -I -z squid
> quirks-2.114 signed on 2015-08-09T11:57:52Z
> Ambiguous: squid could be squid-3.5.6 squid-3.4.13p0
> 
> # pkg_add -I "squid*"
> quirks-2.114 signed on 2015-08-09T11:57:52Z
> Can't find squid*
> 

This can't be done and should NOT be done. if you are asked to choose
between two+ different versions, often that choice is based on the other
package(s) that depend on a particular version. You may even need to
install both versions when two of your other packages require one of
each of the two. See python. I have packages that require python 3.x.x
and some others which require python 2.x.x.
Even more as a good example, look at all of the different versions of
autoconf. How could an automated version of pkg_add possibly guess which
version you actually need in two months?

Chris Bennett

Reply via email to