diff options
-rw-r--r-- | schemas/atom.xsd | 8 | ||||
-rw-r--r-- | schemas/bundle.xsd | 52 | ||||
-rw-r--r-- | schemas/genshi.xsd | 97 | ||||
-rw-r--r-- | schemas/metadata.xsd | 12 | ||||
-rw-r--r-- | schemas/pathentry.xsd | 9 | ||||
-rw-r--r-- | schemas/pkgtype.xsd | 28 | ||||
-rw-r--r-- | schemas/rules.xsd | 73 |
7 files changed, 190 insertions, 89 deletions
diff --git a/schemas/atom.xsd b/schemas/atom.xsd index e25262b45..e1931439e 100644 --- a/schemas/atom.xsd +++ b/schemas/atom.xsd @@ -1,4 +1,5 @@ -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en"> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:py="http://genshi.edgewall.org/" xml:lang="en"> <xsd:annotation> <xsd:documentation> @@ -7,10 +8,13 @@ </xsd:documentation> </xsd:annotation> + <xsd:import namespace="http://genshi.edgewall.org/" + schemaLocation="genshi.xsd"/> + <xsd:complexType name='StructureEntry'> <xsd:attribute type='xsd:string' name='name' use='required'/> - <xsd:attribute type='xsd:string' name='altsrc'/> <xsd:attribute type='xsd:string' name='verify' use='optional'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> </xsd:schema> diff --git a/schemas/bundle.xsd b/schemas/bundle.xsd index bf72915d8..1ea44c991 100644 --- a/schemas/bundle.xsd +++ b/schemas/bundle.xsd @@ -1,4 +1,5 @@ -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en"> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:py="http://genshi.edgewall.org/" xml:lang="en"> <xsd:annotation> <xsd:documentation> @@ -7,6 +8,11 @@ </xsd:documentation> </xsd:annotation> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="xml.xsd"/> + <xsd:import namespace="http://genshi.edgewall.org/" + schemaLocation="genshi.xsd"/> + <xsd:include schemaLocation="atom.xsd"/> <xsd:include schemaLocation="pathentry.xsd"/> <xsd:include schemaLocation="rules.xsd"/> @@ -87,6 +93,13 @@ </xsd:documentation> </xsd:annotation> </xsd:element> + <xsd:element ref="py:def"/> + <xsd:element ref="py:match"/> + <xsd:element ref="py:choose"/> + <xsd:element ref="py:for"/> + <xsd:element ref="py:if"/> + <xsd:element ref="py:with"/> + <xsd:element ref="py:replace"/> </xsd:choice> <xsd:attribute type='xsd:string' name='name' use='required'> <xsd:annotation> @@ -102,23 +115,24 @@ </xsd:documentation> </xsd:annotation> </xsd:attribute> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> <xsd:element name='Bundle'> - <xsd:annotation> - <xsd:documentation> - A bundle describes a group of inter-dependent configuration - entries, such as the combination of packages, configuration - files, and service activations that comprise typical Unix - daemons. Bundles are used to add groups of configuration - entries to the inventory of client configurations, as - opposed to describing particular versions of those - entries. For example, a bundle could say that the - configuration file ``/etc/passwd`` should be included in a - configuration, but will not describe the particular version - of ``/etc/passwd`` that a given client will receive. - </xsd:documentation> - </xsd:annotation> + <xsd:annotation> + <xsd:documentation> + A bundle describes a group of inter-dependent configuration + entries, such as the combination of packages, configuration + files, and service activations that comprise typical Unix + daemons. Bundles are used to add groups of configuration + entries to the inventory of client configurations, as opposed + to describing particular versions of those entries. For + example, a bundle could say that the configuration file + ``/etc/passwd`` should be included in a configuration, but + will not describe the particular version of ``/etc/passwd`` + that a given client will receive. + </xsd:documentation> + </xsd:annotation> <xsd:complexType> <xsd:choice minOccurs='0' maxOccurs='unbounded'> <xsd:element name='Package' type='StructureEntry'> @@ -193,12 +207,20 @@ </xsd:documentation> </xsd:annotation> </xsd:element> + <xsd:element ref="py:def"/> + <xsd:element ref="py:match"/> + <xsd:element ref="py:choose"/> + <xsd:element ref="py:for"/> + <xsd:element ref="py:if"/> + <xsd:element ref="py:with"/> + <xsd:element ref="py:replace"/> </xsd:choice> <xsd:attribute type='xsd:string' name='description' /> <xsd:attribute type='xsd:string' name='name'/> <xsd:attribute type='xsd:string' name='version'/> <xsd:attribute type='xsd:string' name='origin'/> <xsd:attribute type='xsd:string' name='revision'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> </xsd:element> </xsd:schema> diff --git a/schemas/genshi.xsd b/schemas/genshi.xsd new file mode 100644 index 000000000..853b69c0d --- /dev/null +++ b/schemas/genshi.xsd @@ -0,0 +1,97 @@ +<?xml version="1.0"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:py="http://genshi.edgewall.org/" + xml:lang="en" + targetNamespace="http://genshi.edgewall.org/"> + <xs:annotation> + <xs:documentation> + Genshi schema + Chris St. Pierre + $Id$ + </xs:documentation> + </xs:annotation> + + <!-- genshi tags --> + <xs:element name="for" type="py:forType"/> + <xs:complexType name="forType" mixed="true"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:any processContents="lax"/> + </xs:choice> + <xs:attribute name="each" type="xs:string" use="required"/> + </xs:complexType> + + <xs:element name="if" type="py:ifType"/> + <xs:complexType name="ifType" mixed="true"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:any processContents="lax"/> + </xs:choice> + <xs:attribute name="test" type="xs:string" use="required"/> + </xs:complexType> + + <xs:element name="match" type="py:matchType"/> + <xs:complexType name="matchType" mixed="true"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:any processContents="lax"/> + </xs:choice> + <xs:attribute name="path" type="xs:string" use="required"/> + <xs:attribute name="once" type="xs:boolean" default="false"/> + <xs:attribute name="buffer" type="xs:boolean" default="true"/> + <xs:attribute name="recursive" type="xs:boolean" default="true"/> + </xs:complexType> + + <xs:element name="def" type="py:defType"/> + <xs:complexType name="defType" mixed="true"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:any processContents="lax"/> + </xs:choice> + <xs:attribute name="function" type="xs:string" use="required"/> + </xs:complexType> + + <xs:element name="with" type="py:withType"/> + <xs:complexType name="withType" mixed="true"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:any processContents="lax"/> + </xs:choice> + <xs:attribute name="vars" type="xs:string" use="required"/> + </xs:complexType> + + <xs:element name="replace" type="py:replaceType"/> + <xs:complexType name="replaceType" mixed="true"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:any processContents="lax"/> + </xs:choice> + <xs:attribute name="value" type="xs:string" use="required"/> + </xs:complexType> + + <xs:element name="choose" type="py:chooseType"/> + <xs:complexType name="chooseType" mixed="true"> + <xs:sequence> + <xs:element name="when" type="py:ifType" maxOccurs="unbounded"/> + <xs:element name="otherwise" type="py:otherwiseType" + minOccurs="0"/> + </xs:sequence> + <xs:attribute name="test" type="xs:string" use="required"/> + </xs:complexType> + + <xs:complexType name="otherwiseType" mixed="true"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:any processContents="lax"/> + </xs:choice> + </xs:complexType> + + <!-- genshi attributes --> + <xs:attributeGroup name="genshiAttrs"> + <xs:attribute name="ifAttr" type="xs:string"/> + <xs:attribute name="chooseAttr" type="xs:string"/> + <xs:attribute name="whenAttr" type="xs:string"/> + <xs:attribute name="otherwiseAttr" type="xs:string"/> + <xs:attribute name="forAttr" type="xs:string"/> + <xs:attribute name="defAttr" type="xs:string"/> + <xs:attribute name="matchAttr" type="xs:string"/> + <xs:attribute name="withAttr" type="xs:string"/> + <xs:attribute name="attrsAttr" type="xs:string"/> + <xs:attribute name="contentAttr" type="xs:string"/> + <xs:attribute name="replaceAttr" type="xs:string"/> + <xs:attribute name="stripAttr" type="xs:string"/> + </xs:attributeGroup> +</xs:schema> diff --git a/schemas/metadata.xsd b/schemas/metadata.xsd index 1c2474eac..7d07c4971 100644 --- a/schemas/metadata.xsd +++ b/schemas/metadata.xsd @@ -11,12 +11,6 @@ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/> - <xsd:simpleType name='booleanType'> - <xsd:restriction base="xsd:string"> - <xsd:pattern value="true|false"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:complexType name='groupType'> <xsd:choice minOccurs='0' maxOccurs='unbounded'> <xsd:element name='Bundle'> @@ -30,9 +24,9 @@ </xsd:complexType> </xsd:element> </xsd:choice> - <xsd:attribute type='booleanType' name='profile' use='optional'/> - <xsd:attribute type='booleanType' name='public' use='optional'/> - <xsd:attribute type='booleanType' name='default' use='optional'/> + <xsd:attribute type='xsd:boolean' name='profile' use='optional'/> + <xsd:attribute type='xsd:boolean' name='public' use='optional'/> + <xsd:attribute type='xsd:boolean' name='default' use='optional'/> <xsd:attribute type='xsd:string' name='name' use='required'/> <xsd:attribute type='xsd:string' name='auth' use='optional'/> <xsd:attribute type='xsd:string' name='category' use='optional'/> diff --git a/schemas/pathentry.xsd b/schemas/pathentry.xsd index e3bdeddc6..0c27f9112 100644 --- a/schemas/pathentry.xsd +++ b/schemas/pathentry.xsd @@ -1,4 +1,5 @@ -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en"> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:py="http://genshi.edgewall.org/" xml:lang="en"> <xsd:annotation> <xsd:documentation> @@ -8,9 +9,13 @@ </xsd:documentation> </xsd:annotation> + <xsd:import namespace="http://genshi.edgewall.org/" + schemaLocation="genshi.xsd"/> + <xsd:complexType name='PathEntry'> <xsd:attribute type='xsd:string' name='name' use='required'/> <xsd:attribute type='xsd:string' name='altsrc' use='optional'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> <xsd:complexType name='BoundPathEntry'> @@ -21,6 +26,6 @@ <xsd:attribute type='xsd:string' name='prune' use='optional'/> <xsd:attribute type='xsd:string' name='to' use='optional'/> <xsd:attribute type='xsd:string' name='type' use='optional'/> - <xsd:attribute type='xsd:string' name='altsrc' use='optional'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> </xsd:schema> diff --git a/schemas/pkgtype.xsd b/schemas/pkgtype.xsd index 4756f0ecd..ad63cd9d2 100644 --- a/schemas/pkgtype.xsd +++ b/schemas/pkgtype.xsd @@ -1,4 +1,5 @@ -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en"> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:py="http://genshi.edgewall.org/" xml:lang="en"> <xsd:annotation> <xsd:documentation> @@ -9,23 +10,13 @@ </xsd:annotation> <xsd:include schemaLocation="types.xsd"/> + <xsd:import namespace="http://genshi.edgewall.org/" + schemaLocation="genshi.xsd"/> <xsd:complexType name='PackageType'> <xsd:choice minOccurs='0' maxOccurs='unbounded'> - <xsd:element name='Ignore'> - <xsd:complexType> - <xsd:attribute type='xsd:string' name='name'/> - </xsd:complexType> - </xsd:element> <xsd:element name='Instance'> <xsd:complexType> - <xsd:choice minOccurs='0' maxOccurs='unbounded'> - <xsd:element name='Ignore'> - <xsd:complexType> - <xsd:attribute type='xsd:string' name='name'/> - </xsd:complexType> - </xsd:element> - </xsd:choice> <xsd:attribute name='arch' type='xsd:string'/> <xsd:attribute name='epoch' type='xsd:string'/> <xsd:attribute name='version' type='xsd:string'/> @@ -36,10 +27,18 @@ <xsd:attribute name='installed_action' type='xsd:string'/> <xsd:attribute name='version_fail_action' type='xsd:string'/> <xsd:attribute name='verify_fail_action' type='xsd:string'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> </xsd:element> + <xsd:element ref="py:def"/> + <xsd:element ref="py:match"/> + <xsd:element ref="py:choose"/> + <xsd:element ref="py:for"/> + <xsd:element ref="py:if"/> + <xsd:element ref="py:with"/> + <xsd:element ref="py:replace"/> </xsd:choice> - <xsd:attribute type='xsd:string' name='name'/> + <xsd:attribute type='xsd:string' name='name' use="required"/> <xsd:attribute type='xsd:string' name='version'/> <xsd:attribute type='xsd:string' name='file'/> <xsd:attribute type='xsd:string' name='verify'/> @@ -51,5 +50,6 @@ <xsd:attribute type='xsd:string' name='bname'/> <xsd:attribute name='pkg_checks' type='xsd:string'/> <xsd:attribute name='verify_flags' type='xsd:string'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> </xsd:schema> diff --git a/schemas/rules.xsd b/schemas/rules.xsd index 80036834a..bc8a4af80 100644 --- a/schemas/rules.xsd +++ b/schemas/rules.xsd @@ -1,5 +1,6 @@ -<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en"> - +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:py="http://genshi.edgewall.org/" xml:lang="en"> + <xsd:annotation> <xsd:documentation> string enumeration definitions for bcfg2 @@ -10,49 +11,9 @@ <xsd:include schemaLocation="servicetype.xsd"/> <xsd:include schemaLocation="types.xsd"/> - -<xsd:complexType name='PackageType'> - <xsd:choice minOccurs='0' maxOccurs='unbounded'> - <xsd:element name='Ignore'> - <xsd:complexType> - <xsd:attribute type='xsd:string' name='name'/> - </xsd:complexType> - </xsd:element> - <xsd:element name='Instance'> - <xsd:complexType> - <xsd:choice minOccurs='0' maxOccurs='unbounded'> - <xsd:element name='Ignore'> - <xsd:complexType> - <xsd:attribute type='xsd:string' name='name'/> - </xsd:complexType> - </xsd:element> - </xsd:choice> - <xsd:attribute name='arch' type='xsd:string'/> - <xsd:attribute name='epoch' type='xsd:string'/> - <xsd:attribute name='version' type='xsd:string'/> - <xsd:attribute name='release' type='xsd:string'/> - <xsd:attribute name='simplefile' type='xsd:string'/> - <xsd:attribute name='pkg_verify' type='xsd:string'/> - <xsd:attribute name='verify_flags' type='xsd:string'/> - <xsd:attribute name='installed_action' type='xsd:string'/> - <xsd:attribute name='version_fail_action' type='xsd:string'/> - <xsd:attribute name='verify_fail_action' type='xsd:string'/> - </xsd:complexType> - </xsd:element> - </xsd:choice> - <xsd:attribute type='xsd:string' name='name' use='required'/> - <xsd:attribute type='xsd:string' name='version' use='required'/> - <xsd:attribute type='xsd:string' name='file'/> - <xsd:attribute type='xsd:string' name='verify'/> - <xsd:attribute type='xsd:string' name='simplefile'/> - <xsd:attribute type='xsd:string' name='reloc'/> - <xsd:attribute type='xsd:string' name='multiarch'/> - <xsd:attribute type='xsd:string' name='srcs'/> - <xsd:attribute type='xsd:string' name='type' use='required'/> - <xsd:attribute type='xsd:string' name='bname'/> - <xsd:attribute name='pkg_checks' type='xsd:string'/> - <xsd:attribute name='verify_flags' type='xsd:string'/> - </xsd:complexType> + <xsd:include schemaLocation="pkgtype.xsd"/> + <xsd:import namespace="http://genshi.edgewall.org/" + schemaLocation="genshi.xsd"/> <xsd:complexType name='ActionType'> <xsd:attribute type='ActionTimingEnum' name='timing' use='required'/> @@ -60,6 +21,7 @@ <xsd:attribute type='ActionStatusEnum' name='status' use='required'/> <xsd:attribute type='xsd:string' name='name' use='required'/> <xsd:attribute type='xsd:string' name='command' use='required'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> <xsd:complexType name='PathType'> @@ -74,19 +36,28 @@ <xsd:attribute type='xsd:string' name='group'/> <xsd:attribute type='xsd:string' name='prune'/> <xsd:attribute type='xsd:string' name='to'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> <xsd:complexType name='RContainerType'> - <xsd:choice minOccurs='0' maxOccurs='unbounded'> + <xsd:choice minOccurs='0' maxOccurs='unbounded'> <xsd:element name='Service' type='ServiceType'/> <xsd:element name='Package' type='PackageType'/> <xsd:element name='Path' type='PathType'/> <xsd:element name='Action' type='ActionType'/> <xsd:element name='Group' type='RContainerType'/> <xsd:element name='Client' type='RContainerType'/> + <xsd:element ref="py:def"/> + <xsd:element ref="py:match"/> + <xsd:element ref="py:choose"/> + <xsd:element ref="py:for"/> + <xsd:element ref="py:if"/> + <xsd:element ref="py:with"/> + <xsd:element ref="py:replace"/> </xsd:choice> <xsd:attribute name='name' type='xsd:string'/> - <xsd:attribute name='negate' type='xsd:string'/> + <xsd:attribute name='negate' type='xsd:boolean'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> @@ -99,8 +70,16 @@ <xsd:element name='Action' type='ActionType'/> <xsd:element name='Group' type='RContainerType'/> <xsd:element name='Client' type='RContainerType'/> + <xsd:element ref="py:def"/> + <xsd:element ref="py:match"/> + <xsd:element ref="py:choose"/> + <xsd:element ref="py:for"/> + <xsd:element ref="py:if"/> + <xsd:element ref="py:with"/> + <xsd:element ref="py:replace"/> </xsd:choice> <xsd:attribute name='priority' type='xsd:integer' use='required'/> + <xsd:attributeGroup ref="py:genshiAttrs"/> </xsd:complexType> </xsd:element> </xsd:schema> |