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

Re: an idea for next generation APT archive caching



also sprach Matthias Urlichs <smurf@smurf.noris.de> [2004.10.22.2011 +0200]:
> >> exec wget -O - $MIRROR/$RPATH | tee $LPATH
> > 
> Don't forget
>   mkdir -p "$(dirname "$LPATH")"

Why the extra two processes?

mkdir -p ${LPATH%/*}

> The above pipe needs either bash 3 or a subshell, if you want to
> be able to catch any errors wget might die from.

Yes, errors are not easy to handle in shell. That's why this
should be done with Perl/Python, or at least curl.

> One more problem -- what happens if client #2 wants the file while
> the wget is still in progress?

Couldn't you somehow tell apache to not read the premature EOF? The
second client could read the file and the connection would just
block until more data becomes available.

> NB: What to do about no-cache pragmas?

Serve the file but don't store it? Just leave out the tee(1) call in
the above.

> This rapidly turns from a plain 404 error script into a somewhat
> nontrivial Perl-or-Python-or-whatever doument handler.

It's still rather simple. I will have to think about the premature
EOF. I am sure there is a way to do it.

-- 
Please do not CC me when replying to lists; I read them!
 
 .''`.     martin f. krafft <madduck@debian.org>
: :'  :    proud Debian developer, admin, and user
`. `'`
  `-  Debian - when you have better things to do than fixing a system
 
Invalid/expired PGP subkeys? Use subkeys.pgp.net as keyserver!

Attachment: signature.asc
Description: Digital signature


Reply to: