The preceding section has concluded the technicalities of version management applied to packages as such. It remains to consider how this part of ComPact's functionality comes into play wrt. shipping package installations to pools and importing them into other packages.
It has already been indicated that every package installation will be versioned. Predictably, the specific version in question will be derived from the tagging of the work package that has been used to build the installation. If the shipping destination is a project or global pool, then both the installation and the work package versions will be the same. The corresponding shipping command, then, has the form
-ship ( project | global )
ComPact discourages shipping development versions to project or global pools. In other words,
-ship ( project | global )
is intended to be used only when the work package is tagged with a release version.
As for local pools, the situation is somewhat different not only because ComPact does not discourage shipping development installations to such destinations. One must also be able to test a package installation locally before one commits its source files to the repository. At the same time, each commit changes the tagging of the current work package. Local shipping, therefore, cannot be subject to the same invariant as its project-wide or global counterparts. Rather, it must be possible to ship an installation whose version is higher than that of its source files.
For these reasons, the local shipping command has the form
-ship [ local ] [ major | minor | patch]
ComPact will ask you whether you want the shipment to be versioned like the current work package. Provided that your answer is no, it will offer to increase the major number, minor number, or patch level as desired. The default is to increase the patch level.
Other than shipping package installations to pools, be they local, project-wide, or global,
-ship
allows you to install binaries and documentation: If -ship is invoked without any further option and, at the same time, the current work package carrries a release tag, then all derived programs and documentation files will respectively be shipped to the Pkg_BinDir or the Pkg_DocDir (cf. Chapter 6); if -ship is invoked with an option of local, project, or global, then these files will respectively be shipped to the Pkg_LocalBinDir, the Pkg_ProjectBinDir, the Pkg_GlobalBinDir, the Pkg_LocalDocDir, the Pkg_ProjectDocDir, or the Pkg_GlobalDocDir (cf. Section 2.1.2). Shipping to project-wide or global directories, however, will only be performed provided that the current work package is tagged with a release version.
To finish this chapter's main part, the package description syntax wrt. importing package installations is such that syntactic variables may be used instead of major numbers, minor numbers, and patch levels. Also, version ranges may be specified (cf. Section 4.2.6):
VersionRange ::= VersionSpec | VersionSpec '-' VersionSpec VersionSpec ::= ['d']MajorNumber['.'MinorNumber['.'PatchLevel]] MajorNumber ::= Integer | 'x' MinorNumber ::= Integer | 'x' PatchLevel ::= Integer | 'x'ComPact will resolve such specifications so that it chooses the latest admissible version. This mechanism allows you to update packages without having to adjust any related import specifications elsewhere.