On Fri, 25 Dec 2015 16:09:27 -0600 Luke Small <lukensm...@gmail.com> wrote:
> I suppose folks could opt for the more stable yet higher latency
> official mirrors even if they aren't local to canada and they would
> never be surprised. It may not be too much trouble for me to implement
> a mere stdout statement in the perl pkg-add to advise the user to
> update PKG-PATH to randomly offer one of the official mirrors as the
> PKG-PATH (as an easy to implement fix) and steer the user to install a
> web-browser to discover the current list of http/ftp package mirrors
> if Firefox or lynx exists on the system; since they don't by default.
> It wouldn't be too dissimilar to the kind of messages delivered by
> pkg-add itself to rm folder contents at the end of a run.

talk is cheap. if you see a problem, show a fix instead of talking about it.
(i am really starting to feel for the devs. this gets wearying.)

so lynx is gone, but you don't need to install a web browser. ftp(1) is in
base and functions quite well. you want the mirrors?

ftp -o - http://www.openbsd.org/ftp.html | more

will display the html source of the page, which is pretty easy to read even
unrendered.

if you wanted to format it better, you could do:

ftp -o - http://www.openbsd.org/ftp.html | \
sed -n \
    -e 's:</a>$::' \
    -e 's:      <strong>\([^<]*\)<.*:\1 :p' \
    -e 's:^\(   [hfr].*\):\1:p'

(all whitespace in the above sed are single tabs, copy & paste will not work)

will display them all (http,ftp,rsync) as below:

Australia (Adelaide)
        http://mirror.internode.on.net/pub/OpenBSD/
Australia (Brisbane)
        http://mirror.aarnet.edu.au/pub/OpenBSD/
Australia (Perth)
        http://ftp.iinet.net.au/pub/OpenBSD/
...


if you want to test a mirror, just use ftp's return value as below:

ftp -VM -o /dev/null $MIRROR && echo "$MIRROR" >>good-mirrors

or if you had a list of possible mirrors (in file 'mirrors'):

for MIRROR in $(< mirrors); do
  ftp -VM -o /dev/null $MIRROR && echo "$MIRROR"
done >good-mirrors

whenever i want something to work the way i want, i just script around it.
the beauty of unix.

> 
> On 12/25/15, Luke Small <lukensm...@gmail.com> wrote:
> > I suspect that if you did, it wouldn't check whether there was an
> > astronaut ready to control the on-board computer and would sit there
> > continuously trying to rev the rocket engines with no jet fuel. That
> > is the way pkg-add acts right now. I felt pretty ridiculous wondering
> > why pkg-add wasn't working only to figure out I was working with a
> > mirror that was no longer active this week.
> >
> > On 12/24/15, Theo de Raadt <dera...@openbsd.org> wrote:
> >>>I wanna make a c program that checks for a PKG_PATH that exists and
> >>>connects to a workable link for pkg_add().
> >>
> >> and I wanna build a rocket ship...
> >>
> >
> >
> > --
> > -Luke
> >
> 
> 
> -- 
> -Luke

Reply via email to