On Tue, 2007-07-31 at 06:35 +0530, S h i v wrote:
> > what if we do the wget into a temporary file, and if the wget
> > returncode is zero, move the temporary filename into the
> > realy name of the downloaded file?
> > This would at least avoid handling files from unfinished downloads...
> >
> > But I'm not sure, that wget in any different case returns exit-codes
> > we can use to detect, that the downloaded file is correct.
> >
> Even if it had a exit code it wouldn't help for all situations.
> In the scenario I have described wget succeeds in getting the file but
> with a modified name (foo.tar.gz.<n>) which is not recognized by
> pkgtool.

This is a bug.

> There is already copies happening to 3 different dirs:
> download_to dir -> SOURCES dir -> BUILD dir
> Adding another temporary directory might not be a good idea.

I agree.  Think about huge tarballs like firefox.
That said, it's not necessary to have a separate download_to dir.
I'm only using SOURCES so I only have one copy of each tarball.

> Just pkgtool checking the existence of the file with the same name and
> renaming before calling wget might be better (flow mentioned in the
> first mail I sent).

Right.  But if the url is incorrect, then it'll still fail each time.

Laca



Reply via email to