On 2008-02-04 14:51, Ryan Hill wrote:
> Can someone provide a tool that given a package name simply prints the 
> category or cat/pkg, or if ambiguous, prints the multiple cat/pkgs or 
> returns an error code?  I don't care what it's written in as long as it's 
> relatively quick.  I'm sick of depending on udept (which is an incredible 
> tool but a lot heavy for a simple shell script) just to get a simple 
> category.

What about something like this:

--
#!/bin/bash

source /etc/make.globals
source /etc/make.conf

for i in ${PORTDIR} ${PORTDIR_OVERLAY}; do
        (cd $i; a=(*/$1); [ -e ${a[0]} ] && ls -1 -d */$1)
done | sort | uniq
--

It's really fast, at least.

-- 
Heath Caldwell - [EMAIL PROTECTED]
Operating Systems Analyst - California State Polytechnic University, Pomona

Attachment: pgpMH8rxILWSX.pgp
Description: PGP signature

Reply via email to