Gentoo Archives: gentoo-dev

From: Sebastian Werner <sebastian@××××××××××××××××××.de>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] USE database?
Date: Fri, 07 Dec 2001 13:32:15
Message-Id: M052V6341KENHB6KI1WLG6ZGE72RP.3c111845@wp
In Reply to: Re: [gentoo-dev] USE database? by Zach Forrest
1 I like it more to place in in attrib tags:
2
3 <usedatabase>
4
5 <package name="esd" priority="OPTIONAL" depends="media-sound/esound">Enable enlightenment sound daemon support</package>
6
7 </usedatabase>
8
9 Why not XML... it's really nice to edit i think
10
11 Regards
12 Sebastian
13
14 06.12.2001 23:33:21, Zach Forrest <diatribe@××××.ca> wrote:
15
16 > >
17 > > The problem is that writing things in XML will be even harder than the
18 > > pretty clean syntax you proposed.
19 > >
20 >
21 >Maybe a little more laborious, but not really that hard. Take this for
22 >example:
23 >
24 >use_var={"name":"esd",
25 > "description":"Enable enlightenment sound daemon support.",
26 > "priority":"OPTIONAL",
27 > "depends":"media-sound/esound"}
28 >
29 >To write this in XML it would look like this:
30 >
31 ><usedatabase>
32 >
33 > <useflag name=esd>
34 > <description>Enable enlightenment sound daemon support</description>
35 > <priority>OPTIONAL</priority>
36 > <depends>media-sound/esound</depends>
37 > </useflag>
38 >
39 ></usedatabase>
40 >
41 >(OK, not quite as _pretty_, but I've seen worse. The syntax, though, is
42 >clean.)
43 >
44 >Also, I don't think it would be too painful because it's not like
45 >someone would have to spend all day editing/adding entries. It would be
46 >pretty easy to write a script to prompt for the name/desc/etc. and
47 >generate the XML.
48 >
49 >Benefits of using XML also include:
50 >- Rules, such as declaring "priority" flags, can be created in and
51 >enforced by a schema.
52 >- Validation in general.
53 >- Consistent formatting would also be easy with XML.
54 >- Flexibility.
55 >
56 >(Not to sound like a commercial.)
57 >
58 >
59 >
60 >Mikael Hallendal wrote:
61 >
62 >> tor 2001-12-06 klockan 19.12 skrev Zach Forrest:
63 >>
64 >>>Before using python as an example, I had actually played with the idea
65 >>>of using XML. Any thoughts on this? I know that compared to a plain text
66 >>>file both of these notions seem somewhat cumbersome, but there are a
67 >>>couple of arguments for using a more structured approach. One,
68 >>>programatically handling the data is easier. Using either python or XML
69 >>>(and a parser) allows named access rather positional access to the
70 >>>fields. It also makes the definition of "records" more clear and easier
71 >>>to understand for new developers (i.e. me). It wouldn't be too difficult
72 >>>to parse XML (even into a dictionary).
73 >>>
74 >>
75 >> Yes, I thought about using XML too, as you say, for parsing the file
76 >> it'll be better since we don't narrow it down to python. Any language
77 >> that can parse XML (most) can be used for tools and such.
78 >>
79 >> The problem is that writing things in XML will be even harder than the
80 >> pretty clean syntax you proposed.
81 >
82 >>
83 >>>As far as GConf is concerned, I think that the base system should have
84 >>>as few dependencies as possible. Python is already required, and, in my
85 >>>opinion, with its XML capabilities (or just using dictionaries) I
86 >>>believe a solution along these lines would be preferable.
87 >>>
88 >>
89 >> Yes, GConf is IMHO not an option today, perhaps in the future when it:
90 >> 1) is more stable/tested for these kind of things.
91 >> 2) has nice tools for editing the contents.
92 >>
93 >> Regards,
94 >> Mikael Hallendal
95 >>
96 >>
97 >
98 >
99 >_______________________________________________
100 >gentoo-dev mailing list
101 >gentoo-dev@g.o
102 >http://lists.gentoo.org/mailman/listinfo/gentoo-dev
103 >

Replies

Subject Author
Re: [gentoo-dev] USE database? Daniel Robbins <drobbins@g.o>