Element: <version>

Syntax

<!ELEMENT version        (#PCDATA)>
<!ATTLIST version
          condition      (eq | ne | gt | ge | lt | le) #REQUIRED>

This element occurs : Element: <package> | Element: <requires> | Element: <utilizes>

Description

The version element describes a constraint on the version of an utilized or required package.

The condition is satisfied if the comparison specified by the condition attribute applies between the actual version value of the package, and the value specified as the content of the element.

When performing the comparison, the sequences of digits are compared numerically, while all the other characters are compared using their codes. Moreover, any substring is greater than the empty string.

That means, for instance, that 2.0.10 is greater than 2.0.9, 2.0a is greater than 2.0 and 2.10 is greater than 2.1a.

[Note] Note

The algorithm fails for reasonable interpretations of version numbers like 3.0 and 3.0beta. Intuitively, 3.0 is greater than 3.0beta, but the algorithm returns the opposite. To indicate for instance that the required package must have a version greater than 3.0, one would need two version elements, to require that the actual version be greater than or equal to 3.0, and that it be different from 3.0beta.

Examples

<packageinfo>
        <requires>
                <name>guile</name>
                <version condition="ge">1.5</version>
        </requires>
</packageinfo>

This signifies that the package being build requires guile in its version 1.5 or more recent.

There is no equivalent Bash script example for this element.