Gentoo Archives: gentoo-dev

From: "Heath N. Caldwell" <hncaldwell@×××××××××.edu>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: I want to steal your tools
Date: Tue, 05 Feb 2008 01:51:00
Message-Id: 20080205015044.GB4497@grey.iitsystems.csupomona.edu
In Reply to: [gentoo-dev] Re: I want to steal your tools by Ryan Hill
1 On 2008-02-04 14:51, Ryan Hill wrote:
2 > Can someone provide a tool that given a package name simply prints the
3 > category or cat/pkg, or if ambiguous, prints the multiple cat/pkgs or
4 > returns an error code? I don't care what it's written in as long as it's
5 > relatively quick. I'm sick of depending on udept (which is an incredible
6 > tool but a lot heavy for a simple shell script) just to get a simple
7 > category.
8
9 What about something like this:
10
11 --
12 #!/bin/bash
13
14 source /etc/make.globals
15 source /etc/make.conf
16
17 for i in ${PORTDIR} ${PORTDIR_OVERLAY}; do
18 (cd $i; a=(*/$1); [ -e ${a[0]} ] && ls -1 -d */$1)
19 done | sort | uniq
20 --
21
22 It's really fast, at least.
23
24 --
25 Heath Caldwell - hncaldwell@×××××××××.edu
26 Operating Systems Analyst - California State Polytechnic University, Pomona

Replies

Subject Author
[gentoo-dev] Re: I want to steal your tools Ryan Hill <dirtyepic@g.o>