1 |
commit: 275ac5e04bb296394c308bdd6dfd92ac51cfbd42 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 17 08:06:29 2016 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 25 15:28:53 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=275ac5e0 |
7 |
|
8 |
tests: Include metadata.xsd for repoman tests |
9 |
|
10 |
.travis.yml | 4 +- |
11 |
MANIFEST.in | 2 +- |
12 |
cnf/metadata.dtd | 102 ------ |
13 |
cnf/metadata.xsd | 547 +++++++++++++++++++++++++++++++ |
14 |
pym/portage/tests/repoman/test_simple.py | 8 +- |
15 |
5 files changed, 554 insertions(+), 109 deletions(-) |
16 |
|
17 |
diff --git a/.travis.yml b/.travis.yml |
18 |
index b662d94..5213fee 100644 |
19 |
--- a/.travis.yml |
20 |
+++ b/.travis.yml |
21 |
@@ -8,8 +8,8 @@ python: |
22 |
script: |
23 |
- ./setup.py test |
24 |
- ./setup.py install --root=/tmp/install-root |
25 |
- # prevent repoman tests from trying to fetch metadata.dtd |
26 |
+ # prevent repoman tests from trying to fetch metadata.xsd |
27 |
- mkdir -p /tmp/install-root/usr/lib/portage/cnf |
28 |
- - cp cnf/metadata.dtd /tmp/install-root/usr/lib/portage/cnf/ |
29 |
+ - cp cnf/metadata.xsd /tmp/install-root/usr/lib/portage/cnf/ |
30 |
- sudo rsync -a /tmp/install-root/. / |
31 |
- python -b -Wd -m portage.tests.runTests |
32 |
|
33 |
diff --git a/MANIFEST.in b/MANIFEST.in |
34 |
index d65c874..2178460 100644 |
35 |
--- a/MANIFEST.in |
36 |
+++ b/MANIFEST.in |
37 |
@@ -12,7 +12,7 @@ include cnf/make.conf.example.* |
38 |
|
39 |
# extra files for tests |
40 |
include .portage_not_installed |
41 |
-include cnf/metadata.dtd |
42 |
+include cnf/metadata.xsd |
43 |
|
44 |
# extra scripts |
45 |
include misc/* |
46 |
|
47 |
diff --git a/cnf/metadata.dtd b/cnf/metadata.dtd |
48 |
deleted file mode 100644 |
49 |
index ff2649c..0000000 |
50 |
--- a/cnf/metadata.dtd |
51 |
+++ /dev/null |
52 |
@@ -1,102 +0,0 @@ |
53 |
-<!ELEMENT packages ( pkgmetadata* )> |
54 |
- |
55 |
-<!-- Metadata for a category --> |
56 |
-<!ELEMENT catmetadata ( (longdescription)* )> |
57 |
-<!ATTLIST catmetadata pkgname CDATA ""> |
58 |
- |
59 |
-<!-- Metadata for a package --> |
60 |
-<!ELEMENT pkgmetadata ( (herd|maintainer|natural-name|longdescription|use|upstream)* )> |
61 |
-<!ATTLIST pkgmetadata pkgname CDATA ""> |
62 |
- |
63 |
- <!-- One tag for each herd this package is assigned to. --> |
64 |
- <!ELEMENT herd (#PCDATA)> |
65 |
- |
66 |
- <!-- One tag for each maintainer of a package, multiple allowed--> |
67 |
- <!ELEMENT maintainer ( email, (description| name)* )> |
68 |
- |
69 |
- <!-- Natural name for package, example: LibreOffice (for app-office/libreoffice) --> |
70 |
- <!ELEMENT natural-name (#PCDATA) > |
71 |
- |
72 |
- <!-- A long description of the package in freetext--> |
73 |
- <!ELEMENT longdescription (#PCDATA|pkg|cat)* > |
74 |
- |
75 |
- <!-- The changelog of the package--> |
76 |
- <!-- Please note that #PCDATA is mentioned only for the upstream changelog |
77 |
- element, where the content is a URL. This is due to limitations of the DTD --> |
78 |
- <!ELEMENT changelog (#PCDATA|change)* > |
79 |
- <!-- The changelog contains various "changes"--> |
80 |
- <!ELEMENT change (date,(developer|version|description|file|contributor|bug)*) > |
81 |
- <!ELEMENT date (#PCDATA) > |
82 |
- <!-- The date of the change, in "YYYY-MM-DD" format --> |
83 |
- <!ELEMENT developer (name?,email) > |
84 |
- <!-- The developer that made the change. The email is required, name |
85 |
- is optional--> |
86 |
- <!ELEMENT version (#PCDATA) > |
87 |
- <!--version of the packages involved (one tag per version)--> |
88 |
- <!ELEMENT file (#PCDATA) ><!-- one tag per file touched --> |
89 |
- <!ELEMENT contributor (name?,email?) > |
90 |
- <!-- A reference to a user that helped in causing this change. |
91 |
- There should at least be a name or email address included. |
92 |
- Email is preferred --> |
93 |
- <!ELEMENT bug (#PCDATA) > |
94 |
- <!-- bug-id of a bug fixed by this change, multiple allowed. The |
95 |
- format of this is a number or alias for a bug. NOT including a |
96 |
- # character --> |
97 |
- |
98 |
- <!-- description of what this USE flag does for this package --> |
99 |
- <!ELEMENT use (flag)* > |
100 |
- <!ELEMENT flag (#PCDATA|pkg|cat)* > |
101 |
- <!-- name attribute holds the name of the USE flag --> |
102 |
- <!ATTLIST flag name CDATA #REQUIRED > |
103 |
- |
104 |
- <!-- upstream metadata information (maintainers, upstream docs,..) --> |
105 |
- <!ELEMENT upstream (maintainer|changelog|doc|bugs-to|remote-id)* > |
106 |
- <!-- Due to the limitation of DTD this will also allow a status |
107 |
- attribute for the package maintainer element. Please note that |
108 |
- the usage of the status attribute is nevertheless _only_ allowed |
109 |
- in the upstream maintainer element. --> |
110 |
- <!ATTLIST maintainer status (active|inactive|unknown) "unknown" > |
111 |
- <!-- URL where the location of the upstream documentation can be found --> |
112 |
- <!ELEMENT doc (#PCDATA)> |
113 |
- <!ATTLIST doc lang CDATA "C" > |
114 |
- <!-- location where to report bugs |
115 |
- (may also be an email address prefixed with mailto:) --> |
116 |
- <!ELEMENT bugs-to (#PCDATA)> |
117 |
- <!-- specify a type of package identification tracker --> |
118 |
- <!ELEMENT remote-id (#PCDATA)> |
119 |
- <!ATTLIST remote-id type (bitbucket|cpan|cpan-module|cpe|cran|ctan|freecode|freshmeat|github|gitorious|google-code|launchpad|pear|pecl|pypi|rubyforge|rubygems|sourceforge|sourceforge-jp|vim) #REQUIRED> |
120 |
- |
121 |
- <!-- category/package information for cross-linking in descriptions |
122 |
- and useflag descriptions --> |
123 |
- <!ELEMENT pkg (#PCDATA) > |
124 |
- <!ELEMENT cat (#PCDATA) > |
125 |
- |
126 |
-<!-- Common attributes --> |
127 |
- |
128 |
-<!-- the lang attribute, specifies the language of this tag. This is |
129 |
- only useful for descriptions of various kinds. If a tag with this |
130 |
- attribute is included there must be a description in the default |
131 |
- language "C" or "en", which is equivalent --> |
132 |
- <!ATTLIST description lang CDATA "C" > |
133 |
- <!ATTLIST longdescription lang CDATA "C" > |
134 |
- <!ATTLIST use lang CDATA "C" > |
135 |
- |
136 |
-<!-- The restrict attribute, this attribute specifies restrictions on |
137 |
- the applicability of tags on versions. The format of this attribute is |
138 |
- equal to the format of DEPEND lines in ebuilds. There is one special |
139 |
- value though: restrict="*". A tag that specifies this only applies if |
140 |
- there are no other tags that apply. |
141 |
- |
142 |
- For required tags, there must be either an unrestricted version, or a |
143 |
- version that is default restricted. --> |
144 |
- <!ATTLIST herd restrict CDATA #IMPLIED > |
145 |
- <!ATTLIST maintainer restrict CDATA #IMPLIED > |
146 |
- <!ATTLIST longdescription restrict CDATA #IMPLIED > |
147 |
- <!ATTLIST flag restrict CDATA #IMPLIED > |
148 |
- |
149 |
- |
150 |
- |
151 |
-<!-- standard parts --> |
152 |
-<!ELEMENT email (#PCDATA) ><!-- an email address --> |
153 |
-<!ELEMENT name (#PCDATA) ><!-- the name of a person (maintainer, contributor)--> |
154 |
-<!ELEMENT description (#PCDATA) ><!-- A description of a maintainer or change--> |
155 |
|
156 |
diff --git a/cnf/metadata.xsd b/cnf/metadata.xsd |
157 |
new file mode 100644 |
158 |
index 0000000..0ead09e |
159 |
--- /dev/null |
160 |
+++ b/cnf/metadata.xsd |
161 |
@@ -0,0 +1,547 @@ |
162 |
+<?xml version='1.0' encoding='UTF-8'?> |
163 |
+ |
164 |
+<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'> |
165 |
+ <!-- top-level variants --> |
166 |
+ <xs:element name='pkgmetadata' type='pkgMetadataType'> |
167 |
+ <!-- note: restrict uniquity rules are simplified |
168 |
+ the spec says: one for each matched package |
169 |
+ we can only do: one for each restrict rule --> |
170 |
+ <xs:unique name='longDescUniquityConstraint'> |
171 |
+ <xs:selector xpath='longdescription'/> |
172 |
+ <xs:field xpath='@lang'/> |
173 |
+ <xs:field xpath='@restrict'/> |
174 |
+ </xs:unique> |
175 |
+ <xs:unique name='maintainerUniquityConstraint'> |
176 |
+ <xs:selector xpath='maintainer'/> |
177 |
+ <xs:field xpath='email'/> |
178 |
+ <xs:field xpath='@restrict'/> |
179 |
+ </xs:unique> |
180 |
+ <xs:unique name='slotsUniquityConstraint'> |
181 |
+ <xs:selector xpath='slots'/> |
182 |
+ <xs:field xpath='@lang'/> |
183 |
+ </xs:unique> |
184 |
+ <xs:unique name='upstreamSingleConstraint'> |
185 |
+ <xs:selector xpath='upstream'/> |
186 |
+ <xs:field xpath='@fake-only-once'/> |
187 |
+ </xs:unique> |
188 |
+ <xs:unique name='useUniquityConstraint'> |
189 |
+ <xs:selector xpath='use'/> |
190 |
+ <xs:field xpath='@lang'/> |
191 |
+ </xs:unique> |
192 |
+ </xs:element> |
193 |
+ <xs:element name='catmetadata' type='catMetadataType'> |
194 |
+ <xs:unique name='catLongDescUniquityConstraint'> |
195 |
+ <xs:selector xpath='longdescription'/> |
196 |
+ <xs:field xpath='@lang'/> |
197 |
+ </xs:unique> |
198 |
+ </xs:element> |
199 |
+ |
200 |
+ <!-- global elements --> |
201 |
+ <xs:complexType name='pkgMetadataType'> |
202 |
+ <xs:choice minOccurs='0' maxOccurs='unbounded'> |
203 |
+ <xs:element name='longdescription' type='longDescType'/> |
204 |
+ <xs:element name='maintainer' type='maintainerType'> |
205 |
+ <xs:unique name='maintainerDescUniquityConstraint'> |
206 |
+ <xs:selector xpath='description'/> |
207 |
+ <xs:field xpath='@lang'/> |
208 |
+ </xs:unique> |
209 |
+ </xs:element> |
210 |
+ <xs:element name='slots' type='slotsType'> |
211 |
+ <xs:unique name='slotUniquityConstraint'> |
212 |
+ <xs:selector xpath='slot'/> |
213 |
+ <xs:field xpath='@name'/> |
214 |
+ </xs:unique> |
215 |
+ <xs:unique name='subslotsSingleConstraint'> |
216 |
+ <xs:selector xpath='subslots'/> |
217 |
+ <xs:field xpath='@fake-only-once'/> |
218 |
+ </xs:unique> |
219 |
+ </xs:element> |
220 |
+ <xs:element name='upstream' type='upstreamType'> |
221 |
+ <xs:unique name='bugsToSingleConstraint'> |
222 |
+ <xs:selector xpath='bugs-to'/> |
223 |
+ <xs:field xpath='@fake-only-once'/> |
224 |
+ </xs:unique> |
225 |
+ <xs:unique name='changelogSingleConstraint'> |
226 |
+ <xs:selector xpath='changelog'/> |
227 |
+ <xs:field xpath='@fake-only-once'/> |
228 |
+ </xs:unique> |
229 |
+ <!-- prevent accidentally repeating the same remote --> |
230 |
+ <xs:unique name='upstreamRemoteIdRepetitionConstraint'> |
231 |
+ <xs:selector xpath='remote-id'/> |
232 |
+ <xs:field xpath='@type'/> |
233 |
+ <xs:field xpath='.'/> |
234 |
+ </xs:unique> |
235 |
+ <xs:unique name='upstreamDocUniquityConstraint'> |
236 |
+ <xs:selector xpath='doc'/> |
237 |
+ <xs:field xpath='@lang'/> |
238 |
+ </xs:unique> |
239 |
+ </xs:element> |
240 |
+ <xs:element name='use' type='useType'> |
241 |
+ <xs:unique name='flagUniquityConstraint'> |
242 |
+ <xs:selector xpath='flag'/> |
243 |
+ <xs:field xpath='@name'/> |
244 |
+ <xs:field xpath='@restrict'/> |
245 |
+ </xs:unique> |
246 |
+ </xs:element> |
247 |
+ </xs:choice> |
248 |
+ </xs:complexType> |
249 |
+ |
250 |
+ <xs:complexType name='catMetadataType'> |
251 |
+ <xs:choice minOccurs='0' maxOccurs='unbounded'> |
252 |
+ <xs:element name='longdescription' type='catLongDescType'/> |
253 |
+ </xs:choice> |
254 |
+ </xs:complexType> |
255 |
+ |
256 |
+ <!-- the huge <upstream/> structure --> |
257 |
+ <xs:complexType name='upstreamType'> |
258 |
+ <xs:choice minOccurs='0' maxOccurs='unbounded'> |
259 |
+ <xs:element name='maintainer' type='upstreamMaintainerType'> |
260 |
+ <xs:unique name='upstreamMaintainerUniquityConstraint'> |
261 |
+ <xs:selector xpath='maintainer'/> |
262 |
+ <xs:field xpath='name'/> |
263 |
+ </xs:unique> |
264 |
+ </xs:element> |
265 |
+ <xs:element name='changelog' type='urlOnceType'/> |
266 |
+ <xs:element name='doc' type='upstreamDocType'/> |
267 |
+ <xs:element name='bugs-to' type='urlOnceType'/> |
268 |
+ <xs:element name='remote-id' type='upstreamRemoteIdType'/> |
269 |
+ </xs:choice> |
270 |
+ <xs:attribute name='fake-only-once' |
271 |
+ fixed='there can be at most one <upstream/> element'/> |
272 |
+ </xs:complexType> |
273 |
+ |
274 |
+ <!-- maintainer in two variants --> |
275 |
+ <xs:complexType name='maintainerType'> |
276 |
+ <xs:all> |
277 |
+ <xs:element name='email' type='emailType' |
278 |
+ minOccurs='1'/> |
279 |
+ <xs:element name='name' type='xs:token' |
280 |
+ minOccurs='0'/> |
281 |
+ <xs:element name='description' type='maintainerDescType' |
282 |
+ minOccurs='0'/> |
283 |
+ </xs:all> |
284 |
+ <xs:attribute name='type' type='maintainerTypeAttrType' |
285 |
+ use='required'/> |
286 |
+ <xs:attribute name='restrict' type='restrictAttrType'/> |
287 |
+ </xs:complexType> |
288 |
+ |
289 |
+ <xs:simpleType name='maintainerTypeAttrType'> |
290 |
+ <xs:restriction base='xs:token'> |
291 |
+ <xs:enumeration value='person'/> |
292 |
+ <xs:enumeration value='project'/> |
293 |
+ </xs:restriction> |
294 |
+ </xs:simpleType> |
295 |
+ |
296 |
+ <xs:complexType name='upstreamMaintainerType'> |
297 |
+ <xs:all> |
298 |
+ <xs:element name='email' type='emailType' |
299 |
+ minOccurs='0'/> |
300 |
+ <xs:element name='name' type='xs:token' |
301 |
+ minOccurs='0'/> |
302 |
+ </xs:all> |
303 |
+ <xs:attribute name='status' type='upstreamMaintainerStatusAttrType' |
304 |
+ default='unknown'/> |
305 |
+ </xs:complexType> |
306 |
+ |
307 |
+ <xs:simpleType name='upstreamMaintainerStatusAttrType'> |
308 |
+ <xs:restriction base='xs:token'> |
309 |
+ <xs:enumeration value='active'/> |
310 |
+ <xs:enumeration value='inactive'/> |
311 |
+ <xs:enumeration value='unknown'/> |
312 |
+ </xs:restriction> |
313 |
+ </xs:simpleType> |
314 |
+ |
315 |
+ <xs:complexType name='maintainerDescType'> |
316 |
+ <xs:simpleContent> |
317 |
+ <xs:extension base="xs:token"> |
318 |
+ <xs:attribute name='lang' type='langAttrType' default='en'/> |
319 |
+ </xs:extension> |
320 |
+ </xs:simpleContent> |
321 |
+ </xs:complexType> |
322 |
+ |
323 |
+ <!-- long description --> |
324 |
+ <xs:complexType name='longDescType' mixed='true'> |
325 |
+ <xs:choice minOccurs='0' maxOccurs='unbounded'> |
326 |
+ <xs:element name='pkg' type='pkgType'/> |
327 |
+ <xs:element name='cat' type='catType'/> |
328 |
+ </xs:choice> |
329 |
+ <xs:attribute name='lang' type='langAttrType' default='en'/> |
330 |
+ <xs:attribute name='restrict' type='restrictAttrType'/> |
331 |
+ </xs:complexType> |
332 |
+ |
333 |
+ <xs:complexType name='catLongDescType' mixed='true'> |
334 |
+ <xs:choice minOccurs='0' maxOccurs='unbounded'> |
335 |
+ <xs:element name='pkg' type='pkgType'/> |
336 |
+ <xs:element name='cat' type='catType'/> |
337 |
+ </xs:choice> |
338 |
+ <xs:attribute name='lang' type='langAttrType' default='en'/> |
339 |
+ </xs:complexType> |
340 |
+ |
341 |
+ <!-- slots --> |
342 |
+ <xs:complexType name='slotsType'> |
343 |
+ <xs:choice minOccurs='0' maxOccurs='unbounded'> |
344 |
+ <xs:element name='slot' type='slotType'/> |
345 |
+ <xs:element name='subslots' type='tokenOnceType'/> |
346 |
+ </xs:choice> |
347 |
+ <xs:attribute name='lang' type='langAttrType' default='en'/> |
348 |
+ </xs:complexType> |
349 |
+ |
350 |
+ <xs:complexType name='slotType'> |
351 |
+ <xs:simpleContent> |
352 |
+ <xs:extension base="xs:token"> |
353 |
+ <xs:attribute name='name' type='slotNameAttrType' |
354 |
+ use='required'/> |
355 |
+ </xs:extension> |
356 |
+ </xs:simpleContent> |
357 |
+ </xs:complexType> |
358 |
+ |
359 |
+ <xs:simpleType name='slotNameAttrType'> |
360 |
+ <xs:restriction base='xs:token'> |
361 |
+ <!-- PMS 3.1.3 Slot Names + special value '*' --> |
362 |
+ <xs:pattern value="[A-Za-z0-9_][A-Za-z0-9+_.-]*|[*]"/> |
363 |
+ </xs:restriction> |
364 |
+ </xs:simpleType> |
365 |
+ |
366 |
+ <!-- use flags --> |
367 |
+ <xs:complexType name='useType'> |
368 |
+ <xs:choice minOccurs='0' maxOccurs='unbounded'> |
369 |
+ <xs:element name='flag' type='flagType'/> |
370 |
+ </xs:choice> |
371 |
+ <xs:attribute name='lang' type='langAttrType' default='en'/> |
372 |
+ </xs:complexType> |
373 |
+ |
374 |
+ <xs:complexType name='flagType' mixed='true'> |
375 |
+ <xs:choice minOccurs='0' maxOccurs='unbounded'> |
376 |
+ <xs:element name='cat' type='catType'/> |
377 |
+ <xs:element name='pkg' type='pkgType'/> |
378 |
+ </xs:choice> |
379 |
+ <xs:attribute name='name' type='flagNameAttrType' |
380 |
+ use='required'/> |
381 |
+ <xs:attribute name='restrict' type='restrictAttrType' |
382 |
+ default=''/> |
383 |
+ </xs:complexType> |
384 |
+ |
385 |
+ <xs:simpleType name='flagNameAttrType'> |
386 |
+ <xs:restriction base='xs:token'> |
387 |
+ <!-- PMS 3.1.4 USE Flag Names --> |
388 |
+ <xs:pattern value="[A-Za-z0-9][A-Za-z0-9+_@-]*"/> |
389 |
+ </xs:restriction> |
390 |
+ </xs:simpleType> |
391 |
+ |
392 |
+ <!-- upstream-specific types --> |
393 |
+ <xs:complexType name='upstreamDocType'> |
394 |
+ <xs:simpleContent> |
395 |
+ <xs:extension base="urlType"> |
396 |
+ <xs:attribute name='lang' type='langAttrType' default='en'/> |
397 |
+ </xs:extension> |
398 |
+ </xs:simpleContent> |
399 |
+ </xs:complexType> |
400 |
+ |
401 |
+ <xs:complexType name='upstreamRemoteIdType'> |
402 |
+ <xs:simpleContent> |
403 |
+ <xs:extension base="xs:token"> |
404 |
+ <xs:attribute name='type' type='upstreamRemoteIdTypeAttrType' |
405 |
+ use='required'/> |
406 |
+ </xs:extension> |
407 |
+ </xs:simpleContent> |
408 |
+ </xs:complexType> |
409 |
+ |
410 |
+ <xs:simpleType name='upstreamRemoteIdTypeAttrType'> |
411 |
+ <xs:restriction base='xs:token'> |
412 |
+ <xs:enumeration value='bitbucket'/> |
413 |
+ <xs:enumeration value='cpan'/> |
414 |
+ <xs:enumeration value='cpan-module'/> |
415 |
+ <xs:enumeration value='cpe'/> |
416 |
+ <xs:enumeration value='cran'/> |
417 |
+ <xs:enumeration value='ctan'/> |
418 |
+ <xs:enumeration value='freecode'/> |
419 |
+ <xs:enumeration value='freshmeat'/> |
420 |
+ <xs:enumeration value='github'/> |
421 |
+ <xs:enumeration value='gitlab'/> |
422 |
+ <xs:enumeration value='gitorious'/> |
423 |
+ <xs:enumeration value='google-code'/> |
424 |
+ <xs:enumeration value='launchpad'/> |
425 |
+ <xs:enumeration value='pear'/> |
426 |
+ <xs:enumeration value='pecl'/> |
427 |
+ <xs:enumeration value='pypi'/> |
428 |
+ <xs:enumeration value='rubyforge'/> |
429 |
+ <xs:enumeration value='rubygems'/> |
430 |
+ <xs:enumeration value='sourceforge'/> |
431 |
+ <xs:enumeration value='sourceforge-jp'/> |
432 |
+ <xs:enumeration value='vim'/> |
433 |
+ </xs:restriction> |
434 |
+ </xs:simpleType> |
435 |
+ |
436 |
+ <!-- creepy mixed-text types --> |
437 |
+ <xs:simpleType name='catType'> |
438 |
+ <xs:restriction base='xs:token'> |
439 |
+ <!-- PMS 3.1.1 Category Names --> |
440 |
+ <xs:pattern value="[A-Za-z0-9_][A-Za-z0-9+_.-]*"/> |
441 |
+ </xs:restriction> |
442 |
+ </xs:simpleType> |
443 |
+ <xs:simpleType name='pkgType'> |
444 |
+ <xs:restriction base='xs:token'> |
445 |
+ <!-- PMS 3.1.1 Category Names + 3.1.2 Package Names --> |
446 |
+ <!-- note: this does not enforce the 'anything matching |
447 |
+ the version syntax' requirement --> |
448 |
+ <xs:pattern |
449 |
+ value="[A-Za-z0-9_][A-Za-z0-9+_.-]*/[A-Za-z0-9_][A-Za-z0-9+_-]*"/> |
450 |
+ </xs:restriction> |
451 |
+ </xs:simpleType> |
452 |
+ |
453 |
+ <!-- common attributes --> |
454 |
+ <xs:simpleType name='langAttrType'> |
455 |
+ <xs:restriction base='xs:token'> |
456 |
+ <!-- ISO 639-1 language codes --> |
457 |
+ <xs:enumeration value='aa'/> |
458 |
+ <xs:enumeration value='ab'/> |
459 |
+ <xs:enumeration value='ae'/> |
460 |
+ <xs:enumeration value='af'/> |
461 |
+ <xs:enumeration value='ak'/> |
462 |
+ <xs:enumeration value='am'/> |
463 |
+ <xs:enumeration value='an'/> |
464 |
+ <xs:enumeration value='ar'/> |
465 |
+ <xs:enumeration value='as'/> |
466 |
+ <xs:enumeration value='av'/> |
467 |
+ <xs:enumeration value='ay'/> |
468 |
+ <xs:enumeration value='az'/> |
469 |
+ <xs:enumeration value='ba'/> |
470 |
+ <xs:enumeration value='be'/> |
471 |
+ <xs:enumeration value='bg'/> |
472 |
+ <xs:enumeration value='bh'/> |
473 |
+ <xs:enumeration value='bi'/> |
474 |
+ <xs:enumeration value='bm'/> |
475 |
+ <xs:enumeration value='bn'/> |
476 |
+ <xs:enumeration value='bo'/> |
477 |
+ <xs:enumeration value='bo'/> |
478 |
+ <xs:enumeration value='br'/> |
479 |
+ <xs:enumeration value='bs'/> |
480 |
+ <xs:enumeration value='ca'/> |
481 |
+ <xs:enumeration value='ce'/> |
482 |
+ <xs:enumeration value='ch'/> |
483 |
+ <xs:enumeration value='co'/> |
484 |
+ <xs:enumeration value='cr'/> |
485 |
+ <xs:enumeration value='cs'/> |
486 |
+ <xs:enumeration value='cs'/> |
487 |
+ <xs:enumeration value='cu'/> |
488 |
+ <xs:enumeration value='cv'/> |
489 |
+ <xs:enumeration value='cy'/> |
490 |
+ <xs:enumeration value='cy'/> |
491 |
+ <xs:enumeration value='da'/> |
492 |
+ <xs:enumeration value='de'/> |
493 |
+ <xs:enumeration value='de'/> |
494 |
+ <xs:enumeration value='dv'/> |
495 |
+ <xs:enumeration value='dz'/> |
496 |
+ <xs:enumeration value='ee'/> |
497 |
+ <xs:enumeration value='el'/> |
498 |
+ <xs:enumeration value='el'/> |
499 |
+ <xs:enumeration value='en'/> |
500 |
+ <xs:enumeration value='eo'/> |
501 |
+ <xs:enumeration value='es'/> |
502 |
+ <xs:enumeration value='et'/> |
503 |
+ <xs:enumeration value='eu'/> |
504 |
+ <xs:enumeration value='eu'/> |
505 |
+ <xs:enumeration value='fa'/> |
506 |
+ <xs:enumeration value='fa'/> |
507 |
+ <xs:enumeration value='ff'/> |
508 |
+ <xs:enumeration value='fi'/> |
509 |
+ <xs:enumeration value='fj'/> |
510 |
+ <xs:enumeration value='fo'/> |
511 |
+ <xs:enumeration value='fr'/> |
512 |
+ <xs:enumeration value='fr'/> |
513 |
+ <xs:enumeration value='fy'/> |
514 |
+ <xs:enumeration value='ga'/> |
515 |
+ <xs:enumeration value='ga'/> |
516 |
+ <xs:enumeration value='Ga'/> |
517 |
+ <xs:enumeration value='gd'/> |
518 |
+ <xs:enumeration value='gl'/> |
519 |
+ <xs:enumeration value='gn'/> |
520 |
+ <xs:enumeration value='gu'/> |
521 |
+ <xs:enumeration value='gv'/> |
522 |
+ <xs:enumeration value='ha'/> |
523 |
+ <xs:enumeration value='he'/> |
524 |
+ <xs:enumeration value='hi'/> |
525 |
+ <xs:enumeration value='ho'/> |
526 |
+ <xs:enumeration value='hr'/> |
527 |
+ <xs:enumeration value='ht'/> |
528 |
+ <xs:enumeration value='hu'/> |
529 |
+ <xs:enumeration value='hy'/> |
530 |
+ <xs:enumeration value='hy'/> |
531 |
+ <xs:enumeration value='hz'/> |
532 |
+ <xs:enumeration value='ia'/> |
533 |
+ <xs:enumeration value='id'/> |
534 |
+ <xs:enumeration value='ie'/> |
535 |
+ <xs:enumeration value='ig'/> |
536 |
+ <xs:enumeration value='ii'/> |
537 |
+ <xs:enumeration value='ik'/> |
538 |
+ <xs:enumeration value='io'/> |
539 |
+ <xs:enumeration value='is'/> |
540 |
+ <xs:enumeration value='is'/> |
541 |
+ <xs:enumeration value='it'/> |
542 |
+ <xs:enumeration value='iu'/> |
543 |
+ <xs:enumeration value='ja'/> |
544 |
+ <xs:enumeration value='jv'/> |
545 |
+ <xs:enumeration value='ka'/> |
546 |
+ <xs:enumeration value='ka'/> |
547 |
+ <xs:enumeration value='kg'/> |
548 |
+ <xs:enumeration value='ki'/> |
549 |
+ <xs:enumeration value='kj'/> |
550 |
+ <xs:enumeration value='kk'/> |
551 |
+ <xs:enumeration value='kl'/> |
552 |
+ <xs:enumeration value='km'/> |
553 |
+ <xs:enumeration value='kn'/> |
554 |
+ <xs:enumeration value='ko'/> |
555 |
+ <xs:enumeration value='kr'/> |
556 |
+ <xs:enumeration value='ks'/> |
557 |
+ <xs:enumeration value='ku'/> |
558 |
+ <xs:enumeration value='kv'/> |
559 |
+ <xs:enumeration value='kw'/> |
560 |
+ <xs:enumeration value='ky'/> |
561 |
+ <xs:enumeration value='la'/> |
562 |
+ <xs:enumeration value='lb'/> |
563 |
+ <xs:enumeration value='lg'/> |
564 |
+ <xs:enumeration value='li'/> |
565 |
+ <xs:enumeration value='ln'/> |
566 |
+ <xs:enumeration value='lo'/> |
567 |
+ <xs:enumeration value='lt'/> |
568 |
+ <xs:enumeration value='lu'/> |
569 |
+ <xs:enumeration value='lv'/> |
570 |
+ <xs:enumeration value='mg'/> |
571 |
+ <xs:enumeration value='mh'/> |
572 |
+ <xs:enumeration value='mi'/> |
573 |
+ <xs:enumeration value='mi'/> |
574 |
+ <xs:enumeration value='mk'/> |
575 |
+ <xs:enumeration value='mk'/> |
576 |
+ <xs:enumeration value='ml'/> |
577 |
+ <xs:enumeration value='mn'/> |
578 |
+ <xs:enumeration value='mr'/> |
579 |
+ <xs:enumeration value='ms'/> |
580 |
+ <xs:enumeration value='ms'/> |
581 |
+ <xs:enumeration value='mt'/> |
582 |
+ <xs:enumeration value='my'/> |
583 |
+ <xs:enumeration value='my'/> |
584 |
+ <xs:enumeration value='na'/> |
585 |
+ <xs:enumeration value='nb'/> |
586 |
+ <xs:enumeration value='nd'/> |
587 |
+ <xs:enumeration value='ne'/> |
588 |
+ <xs:enumeration value='ng'/> |
589 |
+ <xs:enumeration value='nl'/> |
590 |
+ <xs:enumeration value='nl'/> |
591 |
+ <xs:enumeration value='nn'/> |
592 |
+ <xs:enumeration value='no'/> |
593 |
+ <xs:enumeration value='nr'/> |
594 |
+ <xs:enumeration value='nv'/> |
595 |
+ <xs:enumeration value='ny'/> |
596 |
+ <xs:enumeration value='oc'/> |
597 |
+ <xs:enumeration value='oj'/> |
598 |
+ <xs:enumeration value='om'/> |
599 |
+ <xs:enumeration value='or'/> |
600 |
+ <xs:enumeration value='os'/> |
601 |
+ <xs:enumeration value='pa'/> |
602 |
+ <xs:enumeration value='pi'/> |
603 |
+ <xs:enumeration value='pl'/> |
604 |
+ <xs:enumeration value='ps'/> |
605 |
+ <xs:enumeration value='pt'/> |
606 |
+ <xs:enumeration value='qu'/> |
607 |
+ <xs:enumeration value='rm'/> |
608 |
+ <xs:enumeration value='rn'/> |
609 |
+ <xs:enumeration value='ro'/> |
610 |
+ <xs:enumeration value='ro'/> |
611 |
+ <xs:enumeration value='ru'/> |
612 |
+ <xs:enumeration value='rw'/> |
613 |
+ <xs:enumeration value='sa'/> |
614 |
+ <xs:enumeration value='sc'/> |
615 |
+ <xs:enumeration value='sd'/> |
616 |
+ <xs:enumeration value='se'/> |
617 |
+ <xs:enumeration value='sg'/> |
618 |
+ <xs:enumeration value='si'/> |
619 |
+ <xs:enumeration value='sk'/> |
620 |
+ <xs:enumeration value='sk'/> |
621 |
+ <xs:enumeration value='sl'/> |
622 |
+ <xs:enumeration value='sm'/> |
623 |
+ <xs:enumeration value='sn'/> |
624 |
+ <xs:enumeration value='so'/> |
625 |
+ <xs:enumeration value='sq'/> |
626 |
+ <xs:enumeration value='sq'/> |
627 |
+ <xs:enumeration value='sr'/> |
628 |
+ <xs:enumeration value='ss'/> |
629 |
+ <xs:enumeration value='st'/> |
630 |
+ <xs:enumeration value='su'/> |
631 |
+ <xs:enumeration value='sv'/> |
632 |
+ <xs:enumeration value='sw'/> |
633 |
+ <xs:enumeration value='ta'/> |
634 |
+ <xs:enumeration value='te'/> |
635 |
+ <xs:enumeration value='tg'/> |
636 |
+ <xs:enumeration value='th'/> |
637 |
+ <xs:enumeration value='ti'/> |
638 |
+ <xs:enumeration value='tk'/> |
639 |
+ <xs:enumeration value='tl'/> |
640 |
+ <xs:enumeration value='tn'/> |
641 |
+ <xs:enumeration value='to'/> |
642 |
+ <xs:enumeration value='tr'/> |
643 |
+ <xs:enumeration value='ts'/> |
644 |
+ <xs:enumeration value='tt'/> |
645 |
+ <xs:enumeration value='tw'/> |
646 |
+ <xs:enumeration value='ty'/> |
647 |
+ <xs:enumeration value='ug'/> |
648 |
+ <xs:enumeration value='uk'/> |
649 |
+ <xs:enumeration value='ur'/> |
650 |
+ <xs:enumeration value='uz'/> |
651 |
+ <xs:enumeration value='ve'/> |
652 |
+ <xs:enumeration value='vi'/> |
653 |
+ <xs:enumeration value='vo'/> |
654 |
+ <xs:enumeration value='wa'/> |
655 |
+ <xs:enumeration value='wo'/> |
656 |
+ <xs:enumeration value='xh'/> |
657 |
+ <xs:enumeration value='yi'/> |
658 |
+ <xs:enumeration value='yo'/> |
659 |
+ <xs:enumeration value='za'/> |
660 |
+ <xs:enumeration value='zh'/> |
661 |
+ <xs:enumeration value='zh'/> |
662 |
+ <xs:enumeration value='zu'/> |
663 |
+ </xs:restriction> |
664 |
+ </xs:simpleType> |
665 |
+ |
666 |
+ <xs:simpleType name='restrictAttrType'> |
667 |
+ <xs:restriction base='xs:token'> |
668 |
+ <!-- simplified package dependency syntax --> |
669 |
+ <!-- note: 'pure' package atom is technically valid too |
670 |
+ but not really meaningful --> |
671 |
+ <xs:pattern |
672 |
+ value="(([<>]=?|[=~])[A-Za-z0-9_][A-Za-z0-9+_.-]*/[A-Za-z0-9_][A-Za-z0-9+_-]*-[0-9]+(\.[0-9]+)*[a-z]?((_alpha|_beta|_pre|_rc|_p)[0-9]*)*(-r[0-9]+)?\*?)?"/> |
673 |
+ </xs:restriction> |
674 |
+ </xs:simpleType> |
675 |
+ |
676 |
+ <!-- generic types --> |
677 |
+ <xs:simpleType name='emailType'> |
678 |
+ <xs:restriction base='xs:token'> |
679 |
+ <!-- minimal safe regex --> |
680 |
+ <xs:pattern value="[^@]+@[^.]+\..+"/> |
681 |
+ </xs:restriction> |
682 |
+ </xs:simpleType> |
683 |
+ |
684 |
+ <xs:complexType name='tokenOnceType'> |
685 |
+ <xs:simpleContent> |
686 |
+ <xs:extension base="xs:token"> |
687 |
+ <xs:attribute name='fake-only-once' |
688 |
+ fixed='there can be at most one element of this type'/> |
689 |
+ </xs:extension> |
690 |
+ </xs:simpleContent> |
691 |
+ </xs:complexType> |
692 |
+ |
693 |
+ <xs:simpleType name='urlType'> |
694 |
+ <xs:restriction base='xs:token'> |
695 |
+ <!-- TODO: something better? --> |
696 |
+ <xs:pattern value="(mailto:[^@]+@[^.]+\..+|https?://.+)"/> |
697 |
+ </xs:restriction> |
698 |
+ </xs:simpleType> |
699 |
+ |
700 |
+ <xs:complexType name='urlOnceType'> |
701 |
+ <xs:simpleContent> |
702 |
+ <xs:extension base="urlType"> |
703 |
+ <xs:attribute name='fake-only-once' |
704 |
+ fixed='there can be at most one element of this type'/> |
705 |
+ </xs:extension> |
706 |
+ </xs:simpleContent> |
707 |
+ </xs:complexType> |
708 |
+</xs:schema> |
709 |
|
710 |
diff --git a/pym/portage/tests/repoman/test_simple.py b/pym/portage/tests/repoman/test_simple.py |
711 |
index 720560b..6a79761 100644 |
712 |
--- a/pym/portage/tests/repoman/test_simple.py |
713 |
+++ b/pym/portage/tests/repoman/test_simple.py |
714 |
@@ -128,7 +128,7 @@ class SimpleRepomanTestCase(TestCase): |
715 |
} |
716 |
licenses = ["GPL-2"] |
717 |
arch_list = ["x86"] |
718 |
- metadata_dtd = os.path.join(PORTAGE_BASE_PATH, "cnf/metadata.dtd") |
719 |
+ metadata_xsd = os.path.join(PORTAGE_BASE_PATH, "cnf/metadata.xsd") |
720 |
metadata_xml_files = ( |
721 |
( |
722 |
"dev-libs/A", |
723 |
@@ -269,9 +269,9 @@ class SimpleRepomanTestCase(TestCase): |
724 |
# involving canonical vs. non-canonical paths. |
725 |
test_repo_symlink = os.path.join(eroot, "test_repo_symlink") |
726 |
os.symlink(test_repo_location, test_repo_symlink) |
727 |
- metadata_dtd_dest = os.path.join(test_repo_location, 'metadata/dtd/metadata.dtd') |
728 |
- os.makedirs(os.path.dirname(metadata_dtd_dest)) |
729 |
- os.symlink(metadata_dtd, metadata_dtd_dest) |
730 |
+ metadata_xsd_dest = os.path.join(test_repo_location, 'metadata/xml-schema/metadata.xsd') |
731 |
+ os.makedirs(os.path.dirname(metadata_xsd_dest)) |
732 |
+ os.symlink(metadata_xsd, metadata_xsd_dest) |
733 |
|
734 |
if debug: |
735 |
# The subprocess inherits both stdout and stderr, for |