Date: Sun, 28 Jan 2001 09:50:03 -0800 (PST) From: Peter Pentchev <roam@orbitel.bg> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/24695: [patch] pkg_info: prefix search for a package Message-ID: <200101281750.f0SHo3W08301@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/24695; it has been noted by GNATS. From: Peter Pentchev <roam@orbitel.bg> To: mavetju@chello.nl Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: bin/24695: [patch] pkg_info: prefix search for a package Date: Sun, 28 Jan 2001 19:44:49 +0200 On Sun, Jan 28, 2001 at 05:51:36PM +0100, mavetju@chello.nl wrote: > > >Number: 24695 > >Category: bin > >Synopsis: [patch] pkg_info: prefix search for a package > >Originator: Edwin Groothuis > >Release: FreeBSD 4.2-RELEASE i386 > >Organization: > - > >Environment: > > pkg_install, HEAD tag > main.c: 1.27 > pkg_info.1: 1.31 > perform.c: 1.32 > > > >Description: > > Sometimes I need to find the know the description or the > version of an installed package. Of course, pkg_info -a | > grep string works fine, but userfriendly? By adding the -F > option (fuzzy search), it will not check for the full name > of the package but use the given pkg-name as a prefix in > the package to search for. > > >How-To-Repeat: > > [~] edwin@p6>pkg_info -F screen > Information for screen-3.9.5: > > Comment: > A multi-screen window manager > [...] Hmm.. I've been meaning to try and do something like this for a long time, but I haven't been able to find the time :) Still, now that I've taken a look at code someone has actually written, there are a couple of comments. Shouldn't the FuzzySearch opendir/readdir logic be outside of the pkg_do() routine, and call pkg_do() once for every file it finds? Currently you stop at the very first file you find, which might not be so good if multiple versions of a package are installed, or if the user deliberately tries to query several packages with a common prefix (e.g. mysql-client/ mysql-server). Apart from that, it's great that you've actually taken the time and implemented this :) G'luck, Peter -- This inert sentence is my body, but my soul is alive, dancing in the sparks of your brain. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101281750.f0SHo3W08301>