Try some of these ideas.

Change the config of pf to "conservative" or "high-latency" (man
pf.conf).

Use dpb to download the distfiles:
/usr/ports/infrastructure/bin/dpb -F 2 lang/tcl/8.5
(man -m /usr/ports/infrastructure/man dpb)

Change the ports framework to download the distfiles first from the
OpenBSD mastersites, and adjust the FTP keepalive:
export PORTS_INFRA="/usr/ports/infrastructure/db/network.conf"
echo '.include "../templates/network.conf.template"' > $PORTS_INFRA
echo 'MASTER_SITE_OPENBSD=ftp://ftp.fr.openbsd.org/pub/OpenBSD/distfiles/' >> 
$PORTS_INFRA
echo 'MASTER_SITE_OPENBSD=Yes' >> $PORTS_INFRA
echo 'FTP_KEEPALIVE=15' >> /etc/mk.conf

Create a shell/perl script which retries the download if the file
doesn't exists in the distfiles directory, and change FETCH_CMD to run
it. FETCH_CMD uses this by default: /usr/bin/ftp -V ${_PROGRESS}
-k ${FTP_KEEPALIVE} -C

On Sun, May 17, 2015 at 08:18:06AM -0400, Alan Corey wrote:
> I don't think it did this back in 5.0 days or maybe earlier.  I started
> with OpenBSD 2.7, I just usually attributed problems to being my fault.
> And I've always used the ports tree, not packages. Distfiles are often
> useful across OpenBSD versions, sometimes in FreeBSD, I've even built some
> under Linux.
> 
> I didn't look at what FETCH_CMD was defined as by default, I just assumed
> defining something non-null changed it.  I did notice that when it retries
> it's wrongly assumed there's a problem with the first source and gone to
> another.
> 
> Does every developer have perfect internet?  That's very frustrating, maybe
> counterproductive in testing.  Try a modem, you can probably find a free
> one.  Connection interruptions and resets happen many times a day.
> On May 17, 2015 1:22 AM, "Marc Espie" <es...@nerim.net> wrote:
> 
> > On Sat, May 16, 2015 at 10:31:24PM -0400, Alan Corey wrote:
> > > I'd seen this happen in 5.6 too, but I just caught an example of it in
> > > 5.7.  My connection leaves a lot to be desired, but there's nothing I
> > > can do about that.  I normally have FETCH_CMD set to use wget once I
> > > get it installed but this was in doing a standard make install of a
> > > port.
> > >
> > > The first time the connection gets interrupted, but something thinks
> > > it should be done and checks the size.  That's wrong so it downloads
> > > it over again instead of just resuming the download.  It should only
> > > download it over again if the size matches but the CRC is wrong.
> > > Seems like anyway.
> > >
> > > ===>  Verifying install for tcl-8.5.16 in lang/tcl/8.5
> > > ===>  Checking files for tcl-8.5.16p0
> > > >> Fetch
> > > >> http://downloads.sourceforge.net/sourceforge/tcl/tcl8.5.16-src.tar.gz
> > > tcl8.5.16-src.tar.gz  60% |*****************            |  2696 KB
> > 00:00
> > > >> Size does not match for tcl8.5.16-src.tar.gz
> > > >> Fetch
> > http://ftp.openbsd.org/pub/OpenBSD/distfiles//tcl8.5.16-src.tar.gz
> > > tcl8.5.16-src.tar.gz  23% |******                       |  1024 KB
> > 00:03 ETA
> >
> > The problem lies in ftp(1).
> >
> > Logic in the ports tree is fine. But there's nothing it can do there:
> > somehow
> > your ftp returns 0 (e.g., success), so the partial file gets removed.
> >
> > If you want to get it fixed, you may have to provide more input, as we
> > obviously do not see that problem... First thing would be to override
> > FETCH_CMD to remove the -V, so that you can show us what ftp says about
> > things.  Tracing the code thru the program would help.
> 

-- 
Juan Francisco Cantero Hurtado http://juanfra.info

Reply via email to