Subject: Re: 'make fetch' and partial downloads
To: Frederick Bruckman <fredb@immanent.net>
From: David Brownlee <abs@netbsd.org>
List: tech-pkg
Date: 07/19/2001 14:13:43
On Thu, 19 Jul 2001, Frederick Bruckman wrote:

> On Thu, 19 Jul 2001, David Brownlee wrote:
>
> > 	If 'make fetch' fails part way through a download we are left with
> > 	a partial file which breaks the checksum and has to be manually
> > 	removed before continuing.
>
> Is that a problem? When it happens to me, I just "pd distfiles", "ls
> -alrt" shows the incomplete file at the bottom, "rm" that, and "popd".
>
	Why should you have to do that when pkgsrc can clearly know
	the file is a partial download? (the ftp did not complete).

> I like to use "make checksum" as a normal user to download distfiles,
> and "make package" as root to build, as I find it annoying when pkgsrc
> starts building stuff when I only want to download, and vice-versa.
> It's probably a bug that "make checksum" doesn't check dependencies,
> but I like it, and I'd hate to see it get swept away with a re-write
> of the fetch/checksum targets.
>
	I'm not proposing to change any of that - just download to
	a different name and immediately rename to the correct file
	after download completes successfully (ftp returns 0).

> > 	What do people think about changing the 'make fetch' target to
> > 	download to a temporary file and rename after download is
> > 	complete? Would we want to use a fixed name per distfile
> > 	(eg: ${distfile}.downloading)?
>
> I'm sorry, but I don't see the point. It seems to add complexity for
> no real gain, plus it also seems that you'd lose information (the
> mtime of the distfile, which is useful for singling out the incomplete
> distfiles, at least).
>
	That shouldn't change - its just a mv at the end of the download.

> Possibly more useful would be a target that checksums the distfile
> first, then deletes the file and runs "make checksum" if it doesn't
> match. I don't know if you'd want to make that the default for "fetch"

	Sounds useful, but I'm just looking at 'make fetch' here :)

-- 
		David/absolute		-- www.netbsd.org: No hype required --