[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fetching distfiles (was: Re: window maker dependencies..)



Ted <ted_(_at_)_poox_(_dot_)_com> wrote:

> If you are using ports and you keep getting disconnected when a `make 
> install` is
> downloading a source tarball, then I found this helps:
> vi /etc/mk.conf
> FETCH_CMD=wget -c -t2
> 
> Of course you will need wget first:
> cd /usr/ports/net/wget && make install && make clean
> 
> By having wget with -c when installing a port wget will be used to 
> fetch the sources'
> and will resume downloading the source if interrupted.

if make fetch fails (interrupted internet connection, timeout, etc..),
the partly downloaded source will be deleted.. and if there was a partly
downloades source, make fetch would think it's complete and make
checksum fails.
this is bad if your internet connection is expensive or has limited
time/transfer. is there an easy way to prevent the files being deleted?
i could think of something like this:

$ cat fetcher
#!/bin/sh
FILE=`basename $1`
wget -c $1 -O ${FILE}.part 
RESULT=$?
if [ ${RESULT} = 0 ]; then
  mv ${FILE}.part ${FILE}
else
  return ${RESULT}
fi
$ echo FETCH_CMD=fetcher >> /etc/mk.conf

please post better solutions...

> The -t2 switch just sets a 2 second timeout. You can change this to 
> suit your needs.

nope, -t2 is the same as --tries=2, resulting in 2 retries if download
fails. what you think of is --timeout=2 or -T2.
btw, doesn't make fetch try to fetch it multiple times already?

cu
JRL

-- 
If you don't remember something, it never existed...
If you aren't remembered, you never existed...
I don't quite understand what love is like... But if there
was someone who liked me, I'd be happy.



Visit your host, monkey.org