portsearch: how to display search results

Vasil Dimov vd at datamax.bg
Fri Dec 23 06:41:47 PST 2005


On Thu, Dec 22, 2005 at 08:49:41AM -0800, Michael C. Shultz wrote:
> On Thursday 22 December 2005 08:40, Vasil Dimov wrote:
> > Hi all,
> >
> > I am working on a tool that will allow easy (portsearch -f something)
> > and fast (less than a few seconds) to search for ports that install
> > some file.
> >
> > I see two options for displaying the results:
> >
> > 1) the simple way
> > Show each file that matches a given pattern with some information for
> > the port that would install it. This means that one port may be shown
> > more than once, which I find really irritating.
> >
> > Here is an example output when searching for files that match the
> > regular expression bin/f.*
> >
> > Port: portabc
> > File: bin/f1
> >
> > Port: portabc
> > File: bin/f2
> >
> > Port: portxyz
> > File: bin/f3
> >
> >
> > 2) group files by port
> > Show ports that have at least one file matching a given pattern with all
> > the matching files they install
> >
> > Output from the same search criteria:
> >
> > Port: portabc
> > File(s): bin/f1, bin/f2
> >
> > Port: portxyz
> > File(s): bin/f3
> >
> >
> > My research shows that Debian's ``apt-file search'' and Fedora's
> > ``yum provides'' use "the simple way" and display one package more
> > than once. But 2) seems to me to be the prettier output.
> >
> > What do you think?
> 
> I prefer the files grouped by port, do you have a working example yet? I'd
> like to give it a test run.

Thanks for your response. I implemented grouping and now 1) can easily
be supported, e.g. the prog will support both modes via some command
line options.

I have a working program, but I want to make some cleanup before fireing
it out.

Happy holidays!

-- 
Vasil Dimov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20051223/234b1a45/attachment.bin


More information about the freebsd-ports mailing list