Packaging and Delivering Software With the Image Packaging System in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Constraining Installable Package Versions

Typically, you want a set of packages installed on a system to be supported and upgraded together: Either all packages in the set are updated, or none of the packages in the set is updated. This is the reason for using the incorporate dependency.

Installing a Custom Incorporation in Adding and Updating Software in Oracle Solaris 11.2 shows an example of creating a custom incorporation to constrain the version of the pkg:/entire incorporation that can be installed. The remainder of this section is a more general discussion of incorporations.

The following three partial package manifests show the relationship between the foo and bar packages and the myincorp incorporation package.

The following excerpt is from the foo package manifest:

set name=pkg.fmri value=foo@1.0
dir path=foo owner=root group=bin mode=0755
depend fmri=myincorp type=require

The following excerpt is from the bar package manifest:

set name=pkg.fmri value=bar@1.0
dir path=bar owner=root group=bin mode=0755
depend fmri=myincorp type=require

The following excerpt is from the myincorp package manifest:

set name=pkg.fmri value=myincorp@1.0
depend fmri=foo@1.0 type=incorporate
depend fmri=bar@1.0 type=incorporate

The foo and bar packages both have a require dependency on the myincorp incorporation. The myincorp package has incorporate dependencies that constrain the foo and bar packages in the following ways:

  • The foo and bar packages can be upgraded to at most version 1.0: to the level of granularity defined by the version number specified in the dependency.

  • If the foo and bar packages are installed, they must be at least at version 1.0 or greater.

The incorporate dependency on version 1.0 allows version 1.0.1 or 1.0.2.1, for example, but does not allow version 1.1, 2.0, or 0.9, for example. When an updated incorporation package is installed that specifies incorporate dependencies at a higher version, the foo and bar packages are allowed to update to those higher versions.

Because foo and bar both have require dependencies on the myincorp package, the incorporation package will be installed if either foo or bar is installed or if both foo and bar are installed.