- added weak dependencies to schemas
authorJiri Srain <jsrain@suse.cz>
Wed, 8 Feb 2006 20:24:43 +0000 (20:24 +0000)
committerJiri Srain <jsrain@suse.cz>
Wed, 8 Feb 2006 20:24:43 +0000 (20:24 +0000)
- updated patterh schema

zypp/parser/yum/schema/patch.rnc
zypp/parser/yum/schema/patch.rng
zypp/parser/yum/schema/patterns.rnc
zypp/parser/yum/schema/patterns.rng
zypp/parser/yum/schema/product.rnc
zypp/parser/yum/schema/product.rng
zypp/parser/yum/schema/rpm-ns.rnc
zypp/parser/yum/schema/rpm-ns.rng

index 42e4cb3..8d103a4 100644 (file)
@@ -42,7 +42,9 @@ dependency-block =
   element-conflicts?,
   element-obsoletes?,
   element-freshen?,
-  element-requires?
+  element-requires?,
+  element-recommends?,
+  element-suggests?
 
 element-category =
   element category { "youfix" | "security" | "recommended" | "bonus" | "beta" }
index f024939..71aec61 100644 (file)
     <optional>
       <ref name="element-requires"/>
     </optional>
+    <optional>
+      <ref name="element-recommends"/>
+    </optional>
+    <optional>
+      <ref name="element-suggests"/>
+    </optional>
   </define>
   <define name="element-category">
     <element name="category">
index a41486d..1650316 100644 (file)
@@ -1,7 +1,16 @@
-default namespace = "http://linux.duke.edu/metadata/patterns"
+default namespace = "http://novell.com/package/metadata/suse/pattern"
 
-element patterns {
-  element pattern {
+include "suse-primary.rnc" {
+  start = element-pattern
+  # names in dependencies can include a "kind". Should not be used for packages.
+  attribute-name =
+    attribute kind { "package" | "patch" | "script" | "message" | "product" }?,
+    attribute name { text }
+}
+
+element-pattern = element pattern { pattern }
+
+pattern =
     element patternid { text },
     element name {
       attribute lang { text }?,
@@ -9,26 +18,17 @@ element patterns {
     }+,
     element default { "true" | "false" }?,
     element uservisible { "true" | "false" },
+    element category { text },
+    element icon { text },
+    element script { text }?,
     element description {
       attribute lang { text }?,
       text
     }+,
-    element patternlist {
-      element metapkg {
-        attribute type { text }?,
-        text
-      }+
-    }?,
-    element packagelist {
-      element packagereq {
-        attribute type { text }?,
-        attribute epoch { xsd:nonNegativeInteger },
-        attribute ver { text },
-        attribute rel { text },
-        text
-      }+
-    }?,
-    empty
-  }+,
-  empty
-}
+    element-provides?,
+    element-conflicts?,
+    element-obsoletes?,
+    element-freshen?,
+    element-requires?,
+    element-suggests?,
+    element-recommends?
index 711a41a..824e922 100644 (file)
@@ -1,71 +1,95 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<element name="patterns" ns="http://linux.duke.edu/metadata/patterns" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-  <oneOrMore>
-    <element name="pattern">
-      <element name="patternid">
-        <text/>
-      </element>
-      <oneOrMore>
-        <element name="name">
-          <optional>
-            <attribute name="lang"/>
-          </optional>
-          <text/>
-        </element>
-      </oneOrMore>
+<grammar ns="http://novell.com/package/metadata/suse/pattern" xmlns="http://relaxng.org/ns/structure/1.0">
+  <include href="suse-primary.rng">
+    <start>
+      <ref name="element-pattern"/>
+    </start>
+    <!-- names in dependencies can include a "kind". Should not be used for packages. -->
+    <define name="attribute-name">
       <optional>
-        <element name="default">
+        <attribute name="kind">
           <choice>
-            <value>true</value>
-            <value>false</value>
+            <value>package</value>
+            <value>patch</value>
+            <value>script</value>
+            <value>message</value>
+            <value>product</value>
           </choice>
-        </element>
+        </attribute>
       </optional>
-      <element name="uservisible">
+      <attribute name="name"/>
+    </define>
+  </include>
+  <define name="element-pattern">
+    <element name="pattern">
+      <ref name="pattern"/>
+    </element>
+  </define>
+  <define name="pattern">
+    <element name="patternid">
+      <text/>
+    </element>
+    <oneOrMore>
+      <element name="name">
+        <optional>
+          <attribute name="lang"/>
+        </optional>
+        <text/>
+      </element>
+    </oneOrMore>
+    <optional>
+      <element name="default">
         <choice>
           <value>true</value>
           <value>false</value>
         </choice>
       </element>
-      <oneOrMore>
-        <element name="description">
-          <optional>
-            <attribute name="lang"/>
-          </optional>
-          <text/>
-        </element>
-      </oneOrMore>
-      <optional>
-        <element name="patternlist">
-          <oneOrMore>
-            <element name="metapkg">
-              <optional>
-                <attribute name="type"/>
-              </optional>
-              <text/>
-            </element>
-          </oneOrMore>
-        </element>
-      </optional>
-      <optional>
-        <element name="packagelist">
-          <oneOrMore>
-            <element name="packagereq">
-              <optional>
-                <attribute name="type"/>
-              </optional>
-              <attribute name="epoch">
-                <data type="nonNegativeInteger"/>
-              </attribute>
-              <attribute name="ver"/>
-              <attribute name="rel"/>
-              <text/>
-            </element>
-          </oneOrMore>
-        </element>
-      </optional>
-      <empty/>
+    </optional>
+    <element name="uservisible">
+      <choice>
+        <value>true</value>
+        <value>false</value>
+      </choice>
+    </element>
+    <element name="category">
+      <text/>
+    </element>
+    <element name="icon">
+      <text/>
     </element>
-  </oneOrMore>
-  <empty/>
-</element>
+    <optional>
+      <element name="script">
+        <text/>
+      </element>
+    </optional>
+    <oneOrMore>
+      <element name="description">
+        <optional>
+          <attribute name="lang"/>
+        </optional>
+        <text/>
+      </element>
+    </oneOrMore>
+    <optional>
+      <ref name="element-provides"/>
+    </optional>
+    <optional>
+      <ref name="element-conflicts"/>
+    </optional>
+    <optional>
+      <ref name="element-obsoletes"/>
+    </optional>
+    <optional>
+      <ref name="element-freshen"/>
+    </optional>
+    <optional>
+      <ref name="element-requires"/>
+    </optional>
+    <optional>
+      <ref name="element-suggests"/>
+    </optional>
+    <optional>
+      <ref name="element-recommends"/>
+    </optional>
+  </define>
+</grammar>
index 3695a7d..9f9661a 100644 (file)
@@ -62,5 +62,29 @@ element ns1:product {
       attribute pre { "1" | "0" }?,
       empty
     }*
+  }?,
+  element recommends {
+    element entry {
+      attribute name { text },
+      attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
+      (attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" },
+       attribute epoch { xsd:nonNegativeInteger },
+       attribute ver { text },
+       attribute rel { text }?)?,
+      attribute pre { "1" | "0" }?,
+      empty
+    }*
+  }?,
+  element suggests {
+    element entry {
+      attribute name { text },
+      attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
+      (attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" },
+       attribute epoch { xsd:nonNegativeInteger },
+       attribute ver { text },
+       attribute rel { text }?)?,
+      attribute pre { "1" | "0" }?,
+      empty
+    }*
   }?
 }
index 35ad5e7..0bcbf89 100644 (file)
       </zeroOrMore>
     </element>
   </optional>
+  <optional>
+    <element name="recommends">
+      <zeroOrMore>
+        <element name="entry">
+          <attribute name="name"/>
+          <optional>
+            <attribute name="kind">
+              <choice>
+                <value>package</value>
+                <value>patch</value>
+                <value>script</value>
+                <value>message</value>
+                <value>product</value>
+              </choice>
+            </attribute>
+          </optional>
+          <optional>
+            <attribute name="flags">
+              <choice>
+                <value>EQ</value>
+                <value>LE</value>
+                <value>GE</value>
+                <value>LT</value>
+                <value>GT</value>
+              </choice>
+            </attribute>
+            <attribute name="epoch">
+              <data type="nonNegativeInteger"/>
+            </attribute>
+            <attribute name="ver"/>
+            <optional>
+              <attribute name="rel"/>
+            </optional>
+          </optional>
+          <optional>
+            <attribute name="pre">
+              <choice>
+                <value>1</value>
+                <value>0</value>
+              </choice>
+            </attribute>
+          </optional>
+          <empty/>
+        </element>
+      </zeroOrMore>
+    </element>
+  </optional>
+  <optional>
+    <element name="suggests">
+      <zeroOrMore>
+        <element name="entry">
+          <attribute name="name"/>
+          <optional>
+            <attribute name="kind">
+              <choice>
+                <value>package</value>
+                <value>patch</value>
+                <value>script</value>
+                <value>message</value>
+                <value>product</value>
+              </choice>
+            </attribute>
+          </optional>
+          <optional>
+            <attribute name="flags">
+              <choice>
+                <value>EQ</value>
+                <value>LE</value>
+                <value>GE</value>
+                <value>LT</value>
+                <value>GT</value>
+              </choice>
+            </attribute>
+            <attribute name="epoch">
+              <data type="nonNegativeInteger"/>
+            </attribute>
+            <attribute name="ver"/>
+            <optional>
+              <attribute name="rel"/>
+            </optional>
+          </optional>
+          <optional>
+            <attribute name="pre">
+              <choice>
+                <value>1</value>
+                <value>0</value>
+              </choice>
+            </attribute>
+          </optional>
+          <empty/>
+        </element>
+      </zeroOrMore>
+    </element>
+  </optional>
 </element>
index df22290..c7f0f74 100644 (file)
@@ -16,6 +16,8 @@ format =
     element-conflicts?,
     element-obsoletes?,
     element-requires?,
+    element-recommends?,
+    element-suggests?,
     element-file*
 
 
@@ -104,6 +106,34 @@ requires =
         empty
       }*
 
+element-suggests =
+    element suggests { suggests }
+
+suggests =
+    element entry {
+      attribute-name,
+      (
+        shared-entry-attributes,
+        attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+      )?,
+      attribute pre { "1" | "0" }?,
+        empty
+      }*
+
+element-recommends =
+    element recommends { recommends }
+
+recommends =
+    element entry {
+      attribute-name,
+      (
+        shared-entry-attributes,
+        attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+      )?,
+      attribute pre { "1" | "0" }?,
+        empty
+      }*
+
 element-file =
     element ns1:file { file }
 
index 49eaf48..c5605f6 100644 (file)
     <optional>
       <ref name="element-requires"/>
     </optional>
+    <optional>
+      <ref name="element-recommends"/>
+    </optional>
+    <optional>
+      <ref name="element-suggests"/>
+    </optional>
     <zeroOrMore>
       <ref name="element-file"/>
     </zeroOrMore>
       </element>
     </zeroOrMore>
   </define>
+  <define name="element-suggests">
+    <element name="suggests">
+      <ref name="suggests"/>
+    </element>
+  </define>
+  <define name="suggests">
+    <zeroOrMore>
+      <element name="entry">
+        <ref name="attribute-name"/>
+        <optional>
+          <ref name="shared-entry-attributes"/>
+          <attribute name="flags">
+            <choice>
+              <value>EQ</value>
+              <value>LE</value>
+              <value>GE</value>
+              <value>LT</value>
+              <value>GT</value>
+            </choice>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="pre">
+            <choice>
+              <value>1</value>
+              <value>0</value>
+            </choice>
+          </attribute>
+        </optional>
+        <empty/>
+      </element>
+    </zeroOrMore>
+  </define>
+  <define name="element-recommends">
+    <element name="recommends">
+      <ref name="recommends"/>
+    </element>
+  </define>
+  <define name="recommends">
+    <zeroOrMore>
+      <element name="entry">
+        <ref name="attribute-name"/>
+        <optional>
+          <ref name="shared-entry-attributes"/>
+          <attribute name="flags">
+            <choice>
+              <value>EQ</value>
+              <value>LE</value>
+              <value>GE</value>
+              <value>LT</value>
+              <value>GT</value>
+            </choice>
+          </attribute>
+        </optional>
+        <optional>
+          <attribute name="pre">
+            <choice>
+              <value>1</value>
+              <value>0</value>
+            </choice>
+          </attribute>
+        </optional>
+        <empty/>
+      </element>
+    </zeroOrMore>
+  </define>
   <define name="element-file">
     <element name="ns1:file">
       <ref name="file"/>