[Dwai-developers] DF specs again
Status: Beta
Brought to you by:
lucrus
|
From: Lucio C. <lu...@su...> - 2006-03-31 21:40:14
|
Here I am with the revised XSD that should allow for a list of mirrors instead of a single repository. Apart from that (which ended up in a trivial modification as you can see below), another "problem" arose today in my mind: a .dwai file can contain several versions of the same package, but our XSD doesn't say that anywhere. With this XSD a dewmaster can build a perfectly valid XML .dwai file that contains completely different packages references, not only different versions of the same package. That said, I believe it's not bad to let different packages make it into the .dwai file, because it's trivial for the DC to isolate the different versions of the same package from other entirely different packages: it's enough to look at the common package names. Do you agree if we left that freedom in place? <?xml version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- the debPackageNameType represents the name of a debian package as understood by apt. I choose "token" as the base type because we don't want tabs, CRs and the like in a package name. --> <xs:simpleType name="debPackageNameType"> <xs:restriction base="xs:token"/> </xs:simpleType> <!-- The same comment above fits well in debPackageVersionType --> <xs:simpleType name="debPackageVersionType"> <xs:restriction base="xs:token"/> </xs:simpleType> <!-- There isn't much to say here too --> <xs:simpleType name="debRepositoryURIType"> <xs:restriction base="xs:anyURI"/> </xs:simpleType> <!-- A list of repositories assumed to be mirrors --> <xs:complexType name="debRepositoryMirrorsListType"> <xs:sequence> <xs:element name="mirror" type="debRepositoryURIType" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <!-- This type is used to represent any text that should be present in /etc/apt/preferences for the package to be installed correctly. Here we obviously allow tabs, CRs & Co., hence "string" --> <xs:simpleType name="aptPreferencesTextType"> <xs:restriction base="xs:string"/> </xs:simpleType> <!-- This type will be used to represent any debian flavor the deb package is designed for, such as Sarge, Etch, Knoppix 4.0.2 or Breezy 5.10. I know we should bring some sanity in the format of the flavor name, but I don't really know how to. We could require the flavor name to be just the same text a DC can find in /etc/issue. Any other idea?--> <xs:simpleType name="debianFlavorNameType"> <xs:restriction base="xs:normalizedString"/> </xs:simpleType> <!-- This type is used only in dependencies lists. The deployed deb "package P" may depend on another "package Q *at least* version x.y.z", or on "package Q *exactly* version x.y.z ", or on "package Q *at most* version x.y.z". This type carries that kind of information. I'm not sure the syntax below is correct. --> <xs:simpleType name="debPackageVersionRelationshipType"> <xs:restriction base="xs:token"/> <xs:pattern value="atmost|exactly|atleast"/> </xs:simpleType> <!-- A deb package is the union of a name and a version --> <xs:complexType name="debPackageType"> <xs:sequence> <xs:element name="name" type="debPackageNameType"/> <xs:element name="version" type="debPackageVersionType"/> </xs:sequence> </xs:complexType> <!-- A provider type is a package and a version relationship that can satisfy a particular dependency --> <xs:complexType name="dependencyProviderType"> <xs:sequence> <xs:element name="package" type="debPackageType"/> <xs:element name="versionRelationship" type="debPackageVersionRelationshipType"/> </xs:sequence> </xs:complexType> <!-- A dependency is a list of providers where each one is an alternative that satisfies said dependency. Obscure? Yes! Let's try with an example: "debconf" depends on "debconf-i18n OR debconf-english", so the dependency of debconf is a list of *two* alternative providers, namely "debconf-i18n" and "debconf-english". --> <xs:complexType name="debPackageDependencyType"> <xs:sequence> <xs:element name="provider" type="dependencyProviderType" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <!-- Finally we have the full dependencies list --> <xs:complexType name="debPackageDependenciesListType"> <xs:sequence> <xs:element name="dependency" type="debPackageDependencyType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <!-- A sources list is a list of sources. Ahem, obvious, isn't it? --> <xs:complexType name="debSourcesListType"> <xs:sequence> <xs:element name="source" type="debRepositoryMirrorsListType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <!-- A deployed deb package is a package available for download at the DEW. It consists of everything defined above --> <xs:complexType name="deployedDebPackageType"> <xs:sequence> <xs:element name="package" type="debPackageType"/> <xs:element name="sources" type="debSourcesListType" minOccurs="0" /> <xs:element name="preferences" minOccurs="0" maxOccurs="unbounded" type="aptPreferencesTextType"/> <xs:element name="debianFlavor" maxOccurs="unbounded" type="debianFlavorNameType"/> <xs:element name="dependencies" maxOccurs="unbounded" type="debPackageDependenciesListType"/> </xs:sequence> </xs:complexType> <!-- the DWAI Format can handle multiple packages in a single file, and that's all we say with the dwayType --> <xs:complexType name="dwaiType"> <xs:sequence> <xs:element name="dwaiEntry" type="deployedDebPackageType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <!-- Each XML file has one and only one root element; in this case the root element is the dwai tag --> <xs:element name="dwai" type="dwaiType"/> </xs:schema> |