Gentoo Archives: gentoo-dev

From: Ryan Hill <dirtyepic@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: I want to steal your tools
Date: Tue, 05 Feb 2008 03:21:37
Message-Id: fo8knb$mf5$1@ger.gmane.org
In Reply to: Re: [gentoo-dev] Re: I want to steal your tools by "Heath N. Caldwell"
1 Heath N. Caldwell wrote:
2 > On 2008-02-04 14:51, Ryan Hill wrote:
3 >> Can someone provide a tool that given a package name simply prints the
4 >> category or cat/pkg, or if ambiguous, prints the multiple cat/pkgs or
5 >> returns an error code? I don't care what it's written in as long as it's
6 >> relatively quick. I'm sick of depending on udept (which is an incredible
7 >> tool but a lot heavy for a simple shell script) just to get a simple
8 >> category.
9 >
10 > What about something like this:
11 >
12 > --
13 > #!/bin/bash
14 >
15 > source /etc/make.globals
16 > source /etc/make.conf
17 >
18 > for i in ${PORTDIR} ${PORTDIR_OVERLAY}; do
19 > (cd $i; a=(*/$1); [ -e ${a[0]} ] && ls -1 -d */$1)
20 > done | sort | uniq
21 > --
22 >
23 > It's really fast, at least.
24
25 Also very good, thanks. Instead of sourcing, we can instead use
26
27 $ portageq envvar PORTDIR
28 $ portageq portdir_overlay
29
30 How do paludis and pkgcore make this info available?
31
32
33 --
34 fonts, by design, by neglect
35 gcc-porting, for a fact or just for effect
36 wxwindows @ gentoo EFFD 380E 047A 4B51 D2BD C64F 8AA8 8346 F9A4 0662

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] Re: I want to steal your tools Jeroen Roovers <jer@g.o>
Re: [gentoo-dev] Re: I want to steal your tools "Santiago M. Mola" <coldwind@g.o>