On 7/31/07, Thomas Wagner <Thomas.Wagner at sun.com> wrote: > On Sun, Jul 29, 2007 at 08:09:11PM +0200, Dick Hoogendijk wrote: > > "S h i v " <shivakumar.gn at gmail.com> writes: > > > The actual intention of the mail here was to explain that incase a > > > corrupted tarball already exists under download_to directory, then > > > the subsequent operations of pkgtool will always fail even if the > > > URL is correct. > > YES, that *is* not what we want. Clearly a bug. Hope this will be > > resolved in a future release. > > 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. 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. 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). best regards Shiv
