From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 5 00:34:14 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 1160B1065670 for ; Thu, 5 Jul 2012 00:34:14 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 7FDCF1528D6; Thu, 5 Jul 2012 00:34:13 +0000 (UTC) Message-ID: <4FF4E105.50502@FreeBSD.org> Date: Wed, 04 Jul 2012 17:34:13 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:13.0) Gecko/20120624 Thunderbird/13.0.1 MIME-Version: 1.0 To: Tim Kientzle References: <86bojxow6x.fsf@ds4.des.no> <4FF35864.5030109@FreeBSD.org> <20120704185104.GA42355@DataIX.net> <4FF4B36A.2040608@FreeBSD.org> <20120704180134.7c649e1b@bhuda.mired.org> <4FF4BEED.10103@FreeBSD.org> <20120704225519.GB19945@DataIX.net> <4FF4CAD1.8080804@FreeBSD.org> <20120704234104.GA392@DataIX.net> <8E9DECBB-3D1E-4129-A958-9DB0DF69ECC3@kientzle.com> In-Reply-To: <8E9DECBB-3D1E-4129-A958-9DB0DF69ECC3@kientzle.com> X-Enigmail-Version: 1.4.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org, Mike Meyer Subject: Re: Better error messages for command not found (was Re: Pull in upstream before 9.1 code freeze?) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2012 00:34:14 -0000 On 07/04/2012 17:30, Tim Kientzle wrote: > On Jul 4, 2012, at 4:41 PM, Jason Hellenthal wrote: >> >> On Wed, Jul 04, 2012 at 03:59:29PM -0700, Doug Barton wrote: >>> On 07/04/2012 15:55, Jason Hellenthal wrote: >>>> Seeing as sudo plays a big part of this >>> >>> No ... not only is sudo not a necessary component, it shouldn't be >>> involved at all. The feature works on debian/ubuntu for regular >>> userspace commands. >>> >> >> What are they using to authenticate for the install ? do you know ? > > Huh? What install? Who's talking about install? > > The version of this I've seen looks like this: > > $ svn co https://some.url/ > svn: Command not found. > To use this command, install one of the following packages: > devel/subversion > devel/subversion-freebsd > devel/subversion16 > > That's all it does: It just prints out a more informative error message. > It does not install anything, it requires no special permissions, > and does not (as far as I can see) introduce any security or > performance problems. > > The implementation is pretty simple: > * A tool for building a database that maps command names > to package names. (This would run against a ports tree or > package repository. Conceptually, it's pretty similar to > how port/package indexes get built today.) > * Some way to distribute that database (Probably as part of ISO > releases, maybe extend 'portsnap' or 'pkg_add' to update it?) > * A program to look up command names in that database > and print out the results. > * A shell hook to run said program whenever a "command not found" > error occurs. > > As a first prototype, the database could just be a text file > and the look up program could be a shell script that uses > grep and sed. Right-O. The db should almost certainly be updated and distributed as part of the (already automated) INDEX generation and distribution process. Doug -- This .signature sanitized for your protection