From owner-freebsd-hackers Fri May 28 2:21:28 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id AC02B14F7E for ; Fri, 28 May 1999 02:21:25 -0700 (PDT) (envelope-from des@flood.ping.uio.no) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.1) id LAA05343; Fri, 28 May 1999 11:21:14 +0200 (CEST) (envelope-from des) To: Sheldon Hearn Cc: hackers@freebsd.org Subject: Re: fetch(1) / fetch(3) patchkit available References: <41042.927881541@axl.noc.iafrica.com> From: Dag-Erling Smorgrav Date: 28 May 1999 11:21:13 +0200 In-Reply-To: Sheldon Hearn's message of "Fri, 28 May 1999 10:52:21 +0200" Message-ID: Lines: 40 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sheldon Hearn writes: > On 28 May 1999 10:29:44 +0200, Dag-Erling Smorgrav wrote: > > I brushed the dust off a bunch of patches I had for libfetch and the > > fetch(1) command and made a patchkit of them [...] > Your mail has brought to mind a question I've never managed to sort out > in my head and which I'm loath to post to the list for fear of holy war. > Why do we need a fetch command in the here and now, when ftp appears to > provide equivalent functionality? Good question. The best answer I can give is "do one thing, and do it well". Adding http functionality to ftp(1) was IMHO wrong. Ftp(1) should concentrate on providing an interactive interface to the FTP protocol, and leave the rest to fetch(1). We need generic FTP and HTTP functionality for a variety of applications (first and foremost, sysinstall and pkg_add(1)), and we need a command-line interface to the FTP and HTTP protocols (fetch(1)). We also need an interactive interface to the FTP protocol (for doing stuff like proxying). These are two very different needs; the fetch(3) library is well suited to the former three applications (sysinstall, pkg_add(1) and fetch(1)) but poorly suited to the latter (ftp(1)). We could of course modify ftp(1) to use libfetch for URL parsing and for HTTP, and its own code for FTP... but I would consider that extremely ugly. Anyway, the patchkit doesn't really add much - it reimplements fetch(1) using the fetch(3) library, so we centralize FTP and HTTP functionality in one single library and avoid duplicating code (and bugs!) all over the place. (for the historically impaired, I originally wrote libfetch at Jordan's request for this exact purpose - it was intended to become the backend for the new installation suite, but I haven't heard from Eugene Skepner in over half a year.) DES -- Dag-Erling Smorgrav - des@flood.ping.uio.no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message