Gentoo Archives: gentoo-dev

From: Bob Phan <bob@××××××××××××××××.net>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Parsable list of all use variables.
Date: Mon, 13 May 2002 12:33:52
Message-Id: Pine.LNX.4.21.0205131320550.29338-100000@lucifer.evil-core.com
In Reply to: Re: [gentoo-dev] Parsable list of all use variables. by Karl Trygve Kalleberg
1 On Sun, 12 May 2002, Karl Trygve Kalleberg wrote:
2
3 > On Fri, 10 May 2002, Bob Phan wrote:
4 >
5 <snip>
6 > >
7 > > voodoo3 - Adds support for 3Dfx's Voodoo3 video chipset, else
8 > > defaults to Voodoo4/5 support if not in USE
9 > >
10 <snip>
11 >
12 > This regex handles those cases:
13 >
14 > ^([a-z0-9]+)[ \t]+-.*
15 >
16 The problem with that regex is it only strips out the use variables.
17 I was doing something similar before. But I wanted to be able to
18 easily parse out all the information in that file.
19
20 > > I've already written a script that can mine out all optional use
21 > > statements. Adding the functionality to dynamically go backwards
22 > > through the dependancy tree would be trivial.
23 > >
24 > > I just wanted to get a sense from all of you out there as to what you
25 > > would vote for as a better standard for keeping a separate list with
26 > > this information, which I or anyone can maintain. It would be really
27 > > useful for a few scripts I've been meaning to write, such as a GTK+
28 > > based auto USE var generator. And a "what options are available to me
29 > > in this ebuild before I install it" script. I'm also sure others
30 > > would find some use for such information to be stored in a more usable
31 > > format.
32 >
33 > I used to think the format should be changed. If the use.desc file is
34 > supposed to be only machine-readable, it certainly should be changed.
35 >
36 > However, if users are supposed to read that file as well, we should not
37 > change it, as it is currently easy enough to parse and extremely easy
38 > to read.
39
40 I wouldn't suggest making it any harder to read. Avoiding newlines
41 midrecord wouldn't make reading it much more difficult. Especially if
42 empty lines were permitted. And I liked Georges idea of splitting
43 each line into two parts, use-var<whitespace>description<newline>.
44 Where any whitespace minus newline would be permitted to split the use
45 var from the description.
46
47 > There are currently 255 out of 2959 ebuilds that use undocumented use
48 > flags. These use flags will have to be moved into use.desc.
49 >
50 > There has been discussion of an IUSE var for each ebuild, that lists the
51 > use flags that an ebuild can avail itself of. This would ease up the task
52 > of collectiong these options. In the meantime, the regex
53 >
54 > [^#]*use ([a-z0-9]+).*
55 >
56 > does the trick.
57
58 I was previously parsing that info out of the DEPEND and RDEPEND,
59 grabbing /\?\w+/ for the use vars, but your regex is more elegant.
60 I'll update my script to use that.
61
62 --
63 /*
64 * Bob Phan <bob@××××××××××××××××.net,rphan@××××.com>
65 * Computational Chemistry Informatics
66 * Neurogen Corporation
67 * (203)488-8201 x4645
68 *
69 * To understand recursion, you must first understand recursion.
70 */

Replies

Subject Author
Re: [gentoo-dev] Parsable list of all use variables. George Shapovalov <georges@×××××××××××.edu>