Re: Install latest package without prompts on OpenBSD 7.0
Jeffrey Walton writes: How do I tell pkg_add to install the latest version without prompting me? Proof-of-concept wrapper script, written in Perl: https://gist.github.com/flexibeast/816610233ebbb3745ec43852a96b9248 Alexis.
Re: Install latest package without prompts on OpenBSD 7.0
On Tue, Jan 11, 2022 at 01:13:27AM -, Stuart Henderson wrote: > On 2022-01-10, Ian Darwin wrote: > > On Mon, Jan 10, 2022 at 06:28:38PM -0300, Crystal Kolipe wrote: > >> On Mon, Jan 10, 2022 at 07:15:25PM +0100, Andreas Kusalananda Khri wrote: > >> > Which one is the "latest" here? > >> > > >> > $ doas pkg_add bogofilter > >> > doas (kk@box) password: > >> > quirks-4.92 signed on 2022-01-07T13:45:06Z > >> > Ambiguous: choose package for bogofilter > >> > a 0: > >> > 1: bogofilter-1.2.5 > >> > 2: bogofilter-1.2.5-db4 > >> > 3: bogofilter-1.2.5-lmdb > >> > 4: bogofilter-1.2.5-qdbm > >> > 5: bogofilter-1.2.5-sqlite3 > >> > Your choice: > >> > >> None of them is the 'latest', those are just different 'flavors' of the > >> port. > > > > Agreed. > > > > The discussion was about different numbered versions, but has been hijacked > > to > > be about flavors. > > > > If a "simple automated scripted" pkg_add were desired, it would take choice > > #1 in this > > case or any where there are flavors AND where no flavor was specified. > > For flavours you can choose that with "pkg_add somepkg--". > ..and it would give you DB 3.x which is probably the worst option. Perhaps we need an option to choose a random flavor.
Re: Install latest package without prompts on OpenBSD 7.0
On 2022-01-10, Ian Darwin wrote: > On Mon, Jan 10, 2022 at 06:28:38PM -0300, Crystal Kolipe wrote: >> On Mon, Jan 10, 2022 at 07:15:25PM +0100, Andreas Kusalananda Khri wrote: >> > Which one is the "latest" here? >> > >> >$ doas pkg_add bogofilter >> >doas (kk@box) password: >> >quirks-4.92 signed on 2022-01-07T13:45:06Z >> >Ambiguous: choose package for bogofilter >> >a 0: >> >1: bogofilter-1.2.5 >> >2: bogofilter-1.2.5-db4 >> >3: bogofilter-1.2.5-lmdb >> >4: bogofilter-1.2.5-qdbm >> >5: bogofilter-1.2.5-sqlite3 >> >Your choice: >> >> None of them is the 'latest', those are just different 'flavors' of the port. > > Agreed. > > The discussion was about different numbered versions, but has been hijacked to > be about flavors. > > If a "simple automated scripted" pkg_add were desired, it would take choice > #1 in this > case or any where there are flavors AND where no flavor was specified. For flavours you can choose that with "pkg_add somepkg--". ..and it would give you DB 3.x which is probably the worst option.
Re: Install latest package without prompts on OpenBSD 7.0
On 2022-01-10, Andreas Kusalananda Kähäri wrote: > Which one is the "latest" here? > > $ doas pkg_add bogofilter > doas (kk@box) password: > quirks-4.92 signed on 2022-01-07T13:45:06Z > Ambiguous: choose package for bogofilter > a 0: > 1: bogofilter-1.2.5 > 2: bogofilter-1.2.5-db4 > 3: bogofilter-1.2.5-lmdb > 4: bogofilter-1.2.5-qdbm > 5: bogofilter-1.2.5-sqlite3 bogofilter--lmdb is the latest :)
Re: Install latest package without prompts on OpenBSD 7.0
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 > > > > a0: > > > > 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"
Re: Install latest package without prompts on OpenBSD 7.0
On Mon, Jan 10, 2022 at 06:28:38PM -0300, Crystal Kolipe wrote: > On Mon, Jan 10, 2022 at 07:15:25PM +0100, Andreas Kusalananda Khri wrote: > > Which one is the "latest" here? > > > > $ doas pkg_add bogofilter > > doas (kk@box) password: > > quirks-4.92 signed on 2022-01-07T13:45:06Z > > Ambiguous: choose package for bogofilter > > a 0: > > 1: bogofilter-1.2.5 > > 2: bogofilter-1.2.5-db4 > > 3: bogofilter-1.2.5-lmdb > > 4: bogofilter-1.2.5-qdbm > > 5: bogofilter-1.2.5-sqlite3 > > Your choice: > > None of them is the 'latest', those are just different 'flavors' of the port. Agreed. The discussion was about different numbered versions, but has been hijacked to be about flavors. If a "simple automated scripted" pkg_add were desired, it would take choice #1 in this case or any where there are flavors AND where no flavor was specified.
Re: Install latest package without prompts on OpenBSD 7.0
On Mon, Jan 10, 2022 at 07:15:25PM +0100, Andreas Kusalananda Khri wrote: > Which one is the "latest" here? > > $ doas pkg_add bogofilter > doas (kk@box) password: > quirks-4.92 signed on 2022-01-07T13:45:06Z > Ambiguous: choose package for bogofilter > a 0: > 1: bogofilter-1.2.5 > 2: bogofilter-1.2.5-db4 > 3: bogofilter-1.2.5-lmdb > 4: bogofilter-1.2.5-qdbm > 5: bogofilter-1.2.5-sqlite3 > Your choice: None of them is the 'latest', those are just different 'flavors' of the port.
Re: Install latest package without prompts on OpenBSD 7.0
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 > > > > a0: > > > > 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. > :-) Which one is the "latest" here? $ doas pkg_add bogofilter doas (kk@box) password: quirks-4.92 signed on 2022-01-07T13:45:06Z Ambiguous: choose package for bogofilter a 0: 1: bogofilter-1.2.5 2: bogofilter-1.2.5-db4 3: bogofilter-1.2.5-lmdb 4: bogofilter-1.2.5-qdbm 5: bogofilter-1.2.5-sqlite3 Your choice: -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .
Re: Install latest package without prompts on OpenBSD 7.0
> > > 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 > > > a0: > > > 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. :-)
Re: Install latest package without prompts on OpenBSD 7.0
[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 > > a0: > > 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 >
Re: Install latest package without prompts on OpenBSD 7.0
El lun, 10 ene 2022 a las 4:10, Jeffrey Walton () escribió: > 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 > a0: > 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. > > How do I tell pkg_add to install the latest version without prompting me? > By the way, talking about packages, it should be noted that stating 'latest version' here is an abuse of notation, as those are two different ports, and each one already represents its latest package version. Regards! > Thanks in advance. > >
Re: Install latest package without prompts on OpenBSD 7.0
El lun, 10 ene 2022 a las 4:10, Jeffrey Walton () escribió: > > 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 > a0: > 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. > > How do I tell pkg_add to install the latest version without prompting me? > Not being ambiguous, i.e. with 'sudo pkg_add gcc-12.2.0p0'. If you're looking forward to finding a one-liner able to install the latest version on packages, I'm not aware of any standard way. Taking output from 'pkg_info', filtering and feeding into 'pkg_add' should do the trick. Regards! > Thanks in advance. >
Install latest package without prompts on OpenBSD 7.0
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 a0: 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. How do I tell pkg_add to install the latest version without prompting me? Thanks in advance.