One reason why root names contain a version number is to make it possible to install two different versions of the same software in parallel.
However, version numbers are also used for dependency handling. Let's say Foobar is a GTK+ 2.0 app. Now we have a few problems:
We don't want to check for just "@gtk.org/gtk:2.0.1", we just want to check for *any* 2.0.x release.
At the time Foobar is written, GTK+ 2.2 didn't exist. GTK+ 2.2 is now released, and turns out to be binary compatible with 2.0. How can we know this?
So, we introduce a new kind of version number: interface numbers. Interface numbers are not related to the software's version number: they change when the interface has changed. Interface can mean several things, depending on your software. For shared libraries, it usually indicates binary compatibility, but it can also include things like file formats and command line arguments.
Interface numbers are used to check package compatibility.
Interface numbers are made of two numbers, each separated by a dot:
Major: Every time the interface has changed (binary compatibility changed), this number is increased by 1 and the minor number is reset to 0.
Minor: This number is increased by 1 if something has been added to the interface, like a new function in a library. Apps that depend on previous revision numbers will still work on this revision, but apps that depend on this revision will not work on previous revisions.
Interface numbers only contain numbers, not letters or anything weird like that!
Table 6.1. Software & Interface Number
Software | Interface number |
---|---|
GTK+ 1.2.0 | 1.0 |
GTK+ 1.2.1 | 1.0 |
GTK+ 2.0.0 | 2.0 |
GTK+ 2.2.0 | 2.2 |
GTK+ 2.2.1 | 2.2 |
GTK+ 1.2.1, 2.0.1 and 2.2.1 are bugfix releases. So their major and revision numbers don't change.
GTK+ 2.0 is binary incompatible with GTK+ 1.2, so the major is increased by 1.
GTK+ 2.2 is binary compatible with GTK+ 2.0, but new functions has been added. That's why the major number doesn't change, and the revision number is increased by 1.
GTK is simple, because its software version numbers happen to reflect the interfaces. Other software is less simple, for instance:
Table 6.2. Software & Interface number - Complex
Release name | Major interface number |
---|---|
libpng 1.0.x | 1 |
libpng 1.2.5 | 2 |
libpng 1.2.6 | 3 |
The interface number is not part of the root name, and is stored separately. When software contains multiple interfaces, such as libraries that use symbol versions, the major number stays the same and the revision is incremented.