Versioning your own packages
This page is for developers who publish site packages and the packages they require, and need installations to pick the right copy. It shows every place a version is written, how the kernel reads and compares them, and how to raise them for a new release.
7x and the Exponential Foundation strongly encourage you to submit your packages by pull request to se7enxweb/exponential.packages.exponential.earth, where the release folders follow the Exponential versions: see Contribute your site package.
Contents
- Where versions are written
- How versions are compared
- What min-version does
- What the index version does
- Raising the version for a release
- Published means permanent
Where versions are written
| Place | Example | Meaning |
|---|---|---|
package.xml <version><number> | 1.2.0 | the package's version number |
package.xml <version><release> | 1 | the release number of that version (1 for a new package) |
package.xml <changelog><entry release="..."> | release="1" | which release a changelog entry belongs to |
package.xml <require min-version="..."> | 1.2.0-1 | the lowest version of a required package this one accepts |
package.xml <ezpublish><version> | 6.0.15-stable | the Exponential version the package was made for (the element keeps its historical name) |
index.xml <package version="..."> | 1.2.0-1 | the version the server announces |
| the server folder | exponential/6.0/6.0.15/ | the Exponential release the files were published for |
eZPackage::getVersion() joins number and release as <number>-<release>; that pair is what min-version and the
ezpackage table use. The version attribute of the root <package> element is something else: the kernel writes
the package format version there (eZPackage::VERSION, 3.5.2) when it stores a package.
How versions are compared
kernel/classes/ezpackageversion.php (eZPackageVersion) reads a version number as Semantic Versioning 2.0.0 first:
MAJOR.MINOR.PATCH, with optional-prereleaseand+build(build metadata is ignored when comparing);- older forms are still understood: fewer parts (
1.0reads as1.0.0), more parts (1.2.3.4), a letter suffix (3.4.0beta1is the prereleasebeta1); - anything else is kept as text and sorts before every version that can be read.
The release number is compared last, numerically: 1.0-1 < 1.0-2 < 1.0.1-1, and 1.0-1 equals 1.0.0-1. In a
<number>-<release> pair, the part after the last - is the release only when it is all digits.
New packages from the creation wizards must have a strict SemVer version of at most 24 characters
(eZPackageVersion::isValidNew()); ezpm create takes the version as given. Use strict SemVer for your own packages:
it is the one form every tool reads the same way.
Note
The 7x site packages still carry <number>6.0</number> and <release>15-stable</release>, a form that predates
these rules. Your fork does not have to copy it: reset the version to your own first release, for example
<number>1.0.0</number> and <release>1</release>.
What min-version does
When the setup wizard or the kickstarter installs a site package, downloadDependantPackages() in
kernel/setup/steps/ezstep_site_types.php looks at each <require type="ezpackage">:
| Situation | What happens |
|---|---|
| the required package is not imported | it is downloaded from the url of its index.xml entry and imported |
it is imported with a version lower than min-version (eZPackageVersion::compareFull()) | the old copy is removed and the package downloaded again |
| it is imported with that version or higher | it is used as it is |
| it is not in the index | the install stops with "Download of package '...' failed. You may upload the package manually." |
So raise min-version whenever your site package needs the newer content or classes; otherwise an installation that
imported an older copy keeps it.
What the index version does
In the setup wizard in the browser, a site package that is both in the index and imported locally is offered from
the index when the index version is higher than the local one (compareFull() in createSitePackagesList()), and
the local copy is used otherwise. The kickstarter always prefers the index entry, because, as the code notes, "the
package index version attribute is not comparable with the local package version". Keep the index version equal to
<number>-<release> of the archive it points to, and both readings agree.
Raising the version for a release
- Raise
<number>for a changed package (or<release>for a repackaging of the same content). - Add a
<changelog><entry release="...">describing the change. - Raise
min-versionin every package that needs the change, and their versions in turn. - Rebuild the archives (Rebuilding with build.sh).
- Write the new versions into
index.xml. - Publish into the folder of the Exponential release the packages are for (Running your own package server).
Published means permanent
Once an archive is on a server, installations may have imported it under its version. Never replace a published
archive with different content under the same version: publish a new version, and say in its changelog what was wrong
with the previous one. A version whose last position reaches 9 goes on to 10 (1.0.9 is followed by 1.0.10);
only the last position counts on. The reasoning is on
A pushed tag is permanent and
Only the last position counts.
Related pages
- Making your own site package
- Contribute your site package
- Version numbers
- Dependencies and install order
- Package licenses and versions
- Choosing a version number
- Site packages: start here
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.