From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 5 00:30:27 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AEB9A106564A; Thu, 5 Jul 2012 00:30:27 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 68A868FC14; Thu, 5 Jul 2012 00:30:27 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id q650UP8i095042; Thu, 5 Jul 2012 00:30:25 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id xz9kt6fwt2kf7h9j2ck6mf2hu6; Thu, 05 Jul 2012 00:30:25 +0000 (UTC) (envelope-from tim@kientzle.com) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <20120704234104.GA392@DataIX.net> Date: Wed, 4 Jul 2012 17:30:23 -0700 Content-Transfer-Encoding: 7bit Message-Id: <8E9DECBB-3D1E-4129-A958-9DB0DF69ECC3@kientzle.com> 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> To: Jason Hellenthal X-Mailer: Apple Mail (2.1278) Cc: hackers@freebsd.org, Doug Barton , Mike Meyer Subject: 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:30:27 -0000 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. Tim