Heath N. Caldwell wrote:
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.
Also very good, thanks. Instead of sourcing, we can instead use $ portageq envvar PORTDIR $ portageq portdir_overlay How do paludis and pkgcore make this info available? -- fonts, by design, by neglect gcc-porting, for a fact or just for effect wxwindows @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662
signature.asc
Description: OpenPGP digital signature