Re: add mirror discovery to pkg_add

2016-06-23 Thread Marc Espie
You guys made me think about the actual use case: noob user of OpenBSD, installs the ISO, never gets to have any pkg.conf by default. A way to handle that case would be to have non-network iso *installs* put a pkg.conf that says "hey we didn't configure anything, let's do that later". A bit a

Re: add mirror discovery to pkg_add

2016-06-22 Thread Theo de Raadt
>this is the exact same code that s currently in install.sub >transposed ad perl I get it. It makes sense for installing the base system. We started using it in pkg.conf. I am no longer sure that is the right thing to do. Speaking to the installation backend all the time worries me.

Re: add mirror discovery to pkg_add

2016-06-22 Thread Marc Espie
this is the exact same code that s currently in install.sub transposed ad perl

Re: add mirror discovery to pkg_add

2016-06-22 Thread Theo de Raadt
> On 06/22/16 18:57, Theo de Raadt wrote: > >>> Aside from that, i dont think we should be hardcoding ip-adresses like > >>> that. > >>> > >> we are doing that with miniroot/install.sub, time to change ? > > > > No, that is not what miniroot/install.sub does. Not at all. > > > I know, I just

Re: add mirror discovery to pkg_add

2016-06-22 Thread Giovanni Bechis
On 06/22/16 18:57, Theo de Raadt wrote: >>> Aside from that, i dont think we should be hardcoding ip-adresses like that. >>> >> we are doing that with miniroot/install.sub, time to change ? > > No, that is not what miniroot/install.sub does. Not at all. > I know, I just said that the ip address

Re: add mirror discovery to pkg_add

2016-06-22 Thread Theo de Raadt
> > Aside from that, i dont think we should be hardcoding ip-adresses like that. > > > we are doing that with miniroot/install.sub, time to change ? No, that is not what miniroot/install.sub does. Not at all.

Re: add mirror discovery to pkg_add

2016-06-22 Thread Giovanni Bechis
On 06/22/16 18:28, Sebastian Benoit wrote: > Ted Unangst(t...@tedunangst.com) on 2016.06.22 12:25:04 -0400: >> Marc Espie wrote: >>> This would allow pkg_add to auto-configure a mirror, for the case where >>> PKG_PATH was not specified and where pkg.conf does not exist. >>> >>> It only triggers

Re: add mirror discovery to pkg_add

2016-06-22 Thread Sebastian Benoit
Ted Unangst(t...@tedunangst.com) on 2016.06.22 12:25:04 -0400: > Marc Espie wrote: > > This would allow pkg_add to auto-configure a mirror, for the case where > > PKG_PATH was not specified and where pkg.conf does not exist. > > > > It only triggers when a location ends up empty and when run in

Re: add mirror discovery to pkg_add

2016-06-22 Thread Theo de Raadt
I agree with Ted. This feels very much like building a CDN at the wrong level, considering how slowly and carelessly the mirrors are updated at this time.

Re: add mirror discovery to pkg_add

2016-06-22 Thread Ted Unangst
Marc Espie wrote: > This would allow pkg_add to auto-configure a mirror, for the case where > PKG_PATH was not specified and where pkg.conf does not exist. > > It only triggers when a location ends up empty and when run in interactive > mode, e.g., it shouldn't interfere with local lookups. > >

Re: add mirror discovery to pkg_add

2016-06-22 Thread Marc Espie
Here's an expanded version of the patch. So far, ask_list was happy with prompting, but the mirror list is slightly large, so being able to pipe thru more comes in handy. This means a bit of refactor: we've got state, so we can get the height from a progressmeter (or the stub), and it's

add mirror discovery to pkg_add

2016-06-22 Thread Marc Espie
Most of the code was already there. This would allow pkg_add to auto-configure a mirror, for the case where PKG_PATH was not specified and where pkg.conf does not exist. It only triggers when a location ends up empty and when run in interactive mode, e.g., it shouldn't interfere with local