[elbe-devel] [PATCH 1/1] Add schema definition for initvm/project suite restriction

dion at linutronix.de dion at linutronix.de
Mon Jul 22 13:11:14 CEST 2019


From: Olivier Dion <dion at linutronix.de>

If an invalid suite's name was passed in the <suite> node, then the
build would fail with a traceback, possibly after a long period.

Adding the possible suites in the XML schema allows the build to fail
at the very beginning without a traceback.

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 schema/dbsfed.xsd | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index fbed8e98..542572e9 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -313,7 +313,7 @@
           </documentation>
         </annotation>
       </element>
-      <element name="suite" type="rfs:string">
+      <element name="suite" type="rfs:suite-initvm">
         <annotation>
           <documentation>
             name of the debian suite that should be used to generate the initvm.
@@ -454,7 +454,7 @@
           </documentation>
         </annotation>
       </element>
-      <element name="suite" type="rfs:string">
+      <element name="suite" type="rfs:suite-proj">
         <annotation>
           <documentation>
             name of the debian suite that should be used to generate the
@@ -482,6 +482,24 @@
     <attribute ref="xml:base"/>
   </complexType>
 
+  <simpleType name="suite-initvm">
+    <restriction base="string">
+      <enumeration value="bullseye" />
+      <enumeration value="buster" />
+      <enumeration value="sid" />
+      <enumeration value="stretch" />
+    </restriction>
+  </simpleType>
+
+  <simpleType name="suite-proj">
+    <restriction base="string">
+      <enumeration value="bullseye" />
+      <enumeration value="buster" />
+      <enumeration value="sid" />
+      <enumeration value="stretch" />
+    </restriction>
+  </simpleType>
+
   <complexType name="preference">
     <annotation>
       <documentation>
-- 
2.11.0




More information about the elbe-devel mailing list