summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2009-10-05 07:47:55 +0200
committerSebastian Pipping <sebastian@pipping.org>2009-10-05 07:53:00 +0200
commit91242b66524cce21f3638d626fc95a6a5c8d36bc (patch)
treee47607647a3fc1acff1eeb414bface21772e5807
parentFix <name> duplication in DTD of repositories.xml (diff)
downloadrepositories-xml-format-91242b66524cce21f3638d626fc95a6a5c8d36bc.tar.gz
repositories-xml-format-91242b66524cce21f3638d626fc95a6a5c8d36bc.tar.bz2
repositories-xml-format-91242b66524cce21f3638d626fc95a6a5c8d36bc.zip
Require status and quality level for repositories.xml format
-rw-r--r--schema/repositories.dtd4
-rw-r--r--schema/repositories.rng34
-rwxr-xr-xwrite-repositories-xml.py6
3 files changed, 23 insertions, 21 deletions
diff --git a/schema/repositories.dtd b/schema/repositories.dtd
index d23a4b1..0aa96dc 100644
--- a/schema/repositories.dtd
+++ b/schema/repositories.dtd
@@ -19,8 +19,8 @@
<!ATTLIST repo
xmlns CDATA #FIXED ''
priority CDATA #IMPLIED
- quality (core|stable|testing|experimental|graveyard) #IMPLIED
- status (official|unofficial) #IMPLIED>
+ quality (core|stable|testing|experimental|graveyard) #REQUIRED
+ status (official|unofficial) #REQUIRED>
<!ELEMENT name (#PCDATA)>
<!ATTLIST name
diff --git a/schema/repositories.rng b/schema/repositories.rng
index f75c4eb..7051241 100644
--- a/schema/repositories.rng
+++ b/schema/repositories.rng
@@ -24,25 +24,21 @@
<data type="integer"/>
</attribute>
</optional>
- <optional>
- <attribute name="quality">
- <choice>
- <value>core</value>
- <value>stable</value>
- <value>testing</value>
- <value>experimental</value>
- <value>graveyard</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="status">
- <choice>
- <value>official</value>
- <value>unofficial</value>
- </choice>
- </attribute>
- </optional>
+ <attribute name="quality">
+ <choice>
+ <value>core</value>
+ <value>stable</value>
+ <value>testing</value>
+ <value>experimental</value>
+ <value>graveyard</value>
+ </choice>
+ </attribute>
+ <attribute name="status">
+ <choice>
+ <value>official</value>
+ <value>unofficial</value>
+ </choice>
+ </attribute>
<element name="name">
<text/>
</element>
diff --git a/write-repositories-xml.py b/write-repositories-xml.py
index 6961d19..8c9dff2 100755
--- a/write-repositories-xml.py
+++ b/write-repositories-xml.py
@@ -97,6 +97,12 @@ for overlay in overlays:
for uri in feed_uris:
append_feed(uri, overlay)
+ # Explicify defaults
+ if 'status' not in overlay.attrib:
+ overlay.attrib['status'] = 'unofficial'
+ if 'quality' not in overlay.attrib:
+ overlay.attrib['quality'] = 'experimental'
+
# Transform 'overlays' tag
overlays.tag = 'repositories'