hoooo doggie

This commit is contained in:
brent s
2020-06-18 18:24:13 -04:00
parent 9ec5bee035
commit 5b537e3531
4 changed files with 136 additions and 2 deletions

15
schema/lib/types/ipxe.xsd Normal file
View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:include schemaLocation="../types/unix.xsd"/>
<xs:simpleType name="t_ipxe_patchopt">
<xs:restriction base="xs:token">
<xs:pattern value="[A-Z0-9_]+"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>

View File

@@ -20,7 +20,14 @@
</xs:choice>
</xs:complexType>
<!-- This is more or less the same as t_unix_filepath with the exception of it allowing "/". -->
<!-- These were a pain to figure out. -->
<!-- wtf. doesn't seem to work?
dir: ^\s*(~?/[^/]*)+/?\s*$
file: ^\s*(~?/[^/]+)+\s*$
reldir: ^\s*[^/](([^/]*)+/?)+\s*$
relfile: ^\s*[^/]+([^/]*)+[^/]\s*$
-->
<!-- ABSOLUTE directory path -->
<xs:simpleType name="t_unix_dirpath">
<xs:restriction base="xs:string">
<xs:pattern value="\s*(~?/[^/]*)+/?\s*"/>
@@ -28,13 +35,55 @@
</xs:restriction>
</xs:simpleType>
<!-- RELATIVE directory path -->
<xs:simpleType name="t_unix_reldirpath">
<xs:restriction base="xs:string">
<xs:pattern value="\s*[^/](([^/]*)+/?)+\s*"/>
</xs:restriction>
</xs:simpleType>
<!-- ABSOLUTE file path -->
<xs:simpleType name="t_unix_filepath">
<xs:restriction base="xs:string">
<xs:pattern value="\s*(~?/[^/]+)+/?\s*"/>
<xs:pattern value="\s*(~?/[^/]+)+\s*"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<!-- RELATIVE file path -->
<xs:simpleType name="t_unix_relfilepath">
<xs:restriction base="xs:string">
<xs:pattern value="\s*[^/]+([^/]*)+[^/]\s*"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
<!-- ABSOLUTE path (file or directory) -->
<xs:simpleType name="t_unix_path">
<xs:union memberTypes="t_unix_dirpath t_unix_filepath"/>
</xs:simpleType>
<!-- RELATIVE path (file or directory) -->
<xs:simpleType name="t_unix_relpath">
<xs:union memberTypes="t_unix_reldirpath t_unix_relfilepath"/>
</xs:simpleType>
<!-- ANY valid value for the above types. -->
<xs:simpleType name="t_unix_anypath">
<xs:union memberTypes="t_unix_path t_unix_relpath"/>
</xs:simpleType>
<!-- RELATIVE or ABSOLUTE file path -->
<xs:simpleType name="t_unix_anyfile">
<xs:union memberTypes="t_unix_filepath t_unix_relfilepath"/>
</xs:simpleType>
<!-- RELATIVE or ABSOLUTE dir path -->
<xs:simpleType name="t_unix_anydir">
<xs:union memberTypes="t_unix_dirpath t_unix_reldirpath"/>
</xs:simpleType>
<!-- END of regex silliness. What an ugly annoyance. -->
<xs:complexType name="t_unix_nixpass">
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="passwordPlain">