1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
---
GLEP: 56
Title: USE flag descriptions in metadata
Author: Doug Goldstein <cardoe@gentoo.org>
Type: Standards Track
Status: Replaced
Version: 1
Created: 2008-06-03
Last-Modified: 2020-04-12
Post-History: 2008-06-05, 2008-06-13
Content-Type: text/x-rst
Replaced-By: 68
---
Abstract
========
This GLEP proposes to add per-package USE flag descriptions to each package's
metadata.
Motivation
==========
Gives Gentoo users the ability to better identify how USE flags affect their
installations of a given package. For example, many global USE flags have very
generic descriptions but no specifics on how it affects a certain package.
Specifically speaking, an example would be net-print/cups and the 'jpeg' USE
flag. Does this flag mean you won't be able to print jpeg files? You can print
them directly? Its interface won't use jpeg files.
- Motivator References: [#motivators1]_, [#motivators2]_, [#motivators3]_,
and [#motivators4]_
Specification
=============
This GLEP proposes the addition of ``<use>`` XML tag that is only allowed to
appear inside of a ``<pkgmetadata>`` XML tag.
- Inside the ``<use>`` XML tag, the ``<flag>`` XML tag is allowed to appear
once per USE flag as specified by the ``'name'`` attribute with the
following exception:
* The ``'restrict'`` atttribute can limit to specific versions of the
package, where the attribute value must be a valid CPV as defined by the
`Gentoo Developer Handbook` [#devhandbook]_. This follows the current
behavior of the ``'restrict'`` attribute in metadata.xml.
- e.g. A USE flag may have one behavior for version 0.1 of a package,
while version 0.2, the USE flag may differ slightly.
- Each ``<flag>`` XML tag requires a 'name' attribute which is the full USE
flag name as it would appear in the IUSE section of the ebuild.
* e.g. "video_cards_i810" or "alsa"
- Each ``<flag>`` XML tag allows 0 or more nested ``<pkg>`` XML tags whose
character data is a valid CP or CPV as defined by the
`Gentoo Development Manual - Ebuild File Format` [#devmanual]_.
- Each ``<flag>`` XML tag allows 0 or more nested ``<cat>`` XML tags whose
character data is a valid category.
- The ``<use>`` XML tag may appear multiple times inside of the
``<pkgmetadata>`` XML tag if and only if it contains a different ``'lang'``
attribute value.
* The ``lang`` attribute follows the documented ``lang`` attribute in the
`Gentoo Developer Handbook` [#devhandbook]_.
Documentation for the `Gentoo Developer Handbook` [#devhandbook]_ and the
metadata.dtd can be found in Gentoo's Bugzilla [#use-flag-metadata-bug]_
bug #199788.
The following are two concrete examples in tree, [#use-flag-metadata-example1]_
and [#use-flag-metadata-example2]_.
And the following is an embedded example and not from a real package::
<use>
<flag name='acpi'>Enables HAL to attempt to read from
/proc/acpi/event, if unavailable, HAL will read events from
<pkg>sys-power/acpid</pkg>. If you need multiple acpi readers,
ensure acpid is in your default runlevel
(rc-update add acpid default) along with HAL. This will also
enable HAL to read Toshiba and IBM acpi events which do not
get sent via /proc/acpi/event</flag>
<flag name='spell'>Enables spell checking capability using
dictionaries found in <cat>app-dict</cat></flag>
</use>
Credits
=======
Thanks to the following persons for their input on or related to this GLEP
(even though they might not have known it):
Diego Pettenò (flameeyes), Alec Warner (antarus), Joshua Nichols (nichoj),
Steve Dibb (beandog), and Tiziano Müller (dev-zero)
References
==========
.. [#use-flag-metadata-bug] https://bugs.gentoo.org/199788
.. [#use-flag-metadata-example1] https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/hal/metadata.xml?view=markup
.. [#use-flag-metadata-example2] https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-tv/mythtv/metadata.xml?view=markup
.. [#devhandbook] https://devmanual.gentoo.org/ebuild-writing/misc-files/metadata/index.html
.. [#devmanual] https://devmanual.gentoo.org/ebuild-writing/file-format/index.html
.. [#motivators1] https://flameeyes.blog/2007/11/19/lets-actually-get-some-metadata/
.. [#motivators2] https://cardoe.wordpress.com/2007/11/19/use-flag-metadata/
.. [#motivators3] https://cardoe.wordpress.com/2007/11/23/metadataxml-updates-examples/
.. [#motivators4] https://technicalpickles.com/posts/pidgin-idle-time
Backwards Compatibility
=======================
No changes are necessary to existing ``metadata.xml`` files. Information in
the new tags is not mandatory. Tools that currently read ``metadata.xml``
files may break if written poorly, while well written tools should just ignore
the additional elements. Tools which are capable of handling the new tags
should prefer their data over ``use.desc`` and ``use.local.desc``.
USE flags still must be defined in ``use.desc`` or ``use.local.desc``. If the
USE flag is not found in either ``use.desc`` or ``use.local.desc``, the
information contained within the new tags in ``metadata.xml`` must be ignored
and QA tools should warn as they currently do.
Once this GLEP is approved, the Gentoo Infrastructure Team will work to remove
the ``use.local.desc`` file from CVS and it will be auto-generated for rsync.
This will ensure that backwards compatibility is not broken for users of
non-CVS trees. At this time, QA tools will need to be updated to verify the
contents of ``metadata.xml`` containing the necessary tags which would appear
in ``use.local.desc``.
Copyright
=========
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0
International License. To view a copy of this license, visit
https://creativecommons.org/licenses/by-sa/4.0/.
.. vim: set ft=glep tw=72 :
|