2573N/A.. The contents of this file are subject to the terms of the
2573N/A Common Development and Distribution License (the "License").
2573N/A You may not use this file except in compliance with the License.
2573N/A See the License for the specific language governing permissions
2573N/A and limitations under the License.
2573N/A.. When distributing Covered Code, include this CDDL HEADER in each
2573N/A If applicable, add the following below this CDDL HEADER, with the
2573N/A fields enclosed by brackets "[]" replaced with your own identifying
2573N/A information: Portions Copyright [yyyy] [name of copyright owner]
2573N/A.. Copyright (c) 2011, Oracle
and/or its affiliates. All rights reserved.
2525N/AIPS provide a variety of different dependency types as discussed in
2573N/A*Chapter 3*; in this chapter we go into more detail about how each
2525N/Adependency type can be used to control the software that is installed.
2573N/ADependencies in IPS are additive; all package dependencies
2525N/Amust be satisfied in order to permit installation. IPS allows
2525N/Apackages to be mutually dependent. In addition, you may have
2525N/Adifferent kinds of dependencies on the same package at the
2525N/Asame time; this allows one to achieve the desired relationship
2525N/Abetween packages using the dependencies as building blocks.
2525N/AThe most basic type of dependency is the 'require' dependency. If a
2525N/Apackage A@1.0' contains a 'require' dependency on pkg B@2, it means
2525N/Athat if A@1.0 is installed, a version of B at 2 or higher must be
2525N/Ainstalled as well. This acceptance of higher versioned packages
2525N/Areflects the implicit expectation of binary compatibility in newer
2525N/Aversions of existing packages. These dependencies are typically used
2525N/Ato express functional dependencies such as libraries or interpreters
2573N/Asuch as python, perl, etc. The version portion of the specified FMRI
2525N/Amay be omitted; it indicates that any version will suffice. The
2525N/Alatter may not be actually true, but if other dependencies constrain
2525N/Athe version adequately, this may save some effort.
2573N/AThe ``require-any`` dependency is used if more than one package will
2573N/Asatisfy a functional requirement. IPS will pick one of the packages
2573N/Ato install if the dependency is not already satisfied; which one is
2525N/Aselected is an implementation detail. A typical use might be to
2525N/Ainsure that at least one version of perl was installed on the system,
2525N/Afor example. The versioning is handled in the same manner as
2573N/AThe ``optional`` dependency is similar to the ``require`` dependency, but
2525N/Athe specified package need not be installed. However, if it is
2525N/Apresent, it must be at the specified version or greater. This type of
2525N/Adependency is typically used to handle cases where packages transfer
2525N/Acontent. In this case, each version of the package post-transfer
2525N/Awould contain an optional dependency on the other package's
2525N/Apost-transfer version, so it would be impossible to install
2525N/Aincompatible versions of the two packages. Omitting the version on an
2525N/Aoptional dependency makes the dependency a no-op, but is permitted.
2573N/AThe ``conditional`` dependency is similar to the ``require`` dependency as
2525N/Awell, except that a predicate attribute is present; if the package
2525N/Aspecified therein is present on the system at the specified or greater
2573N/Aversion, the conditional dependency is treated as a ``require``
2525N/Adependency, otherwise it is ignored. This type of dependency is most
2525N/Aoften used to bring in optional extensions to a package if the
2525N/Arequisite base packages are present on the system. For example, an
2525N/Aeditor package that has both X11 and terminal versions might chose to
2573N/Aplace the X11 version in a separate package, and include a conditional
2525N/Adependency on the X11 version from the text version with the existence
2525N/Aof the requisite X client library package as the predicate.
2573N/AThe ``group`` dependency is used as one would expect to construct groups
2525N/Aof packages. The group dependency will ignore the version specified;
2573N/Aany version of the named package satisfies this dependency. The
2573N/Anamed package is required, unless either the package has been placed on
2525N/Athe avoid list (see pkg(1)) or the package is explicitly rejected
2573N/Aduring installation or specifically uninstalled. This allow
2525N/Aadministrators to 'deselect' packages that are the subject of a group
2525N/Adependency. IPS will remember this and not re-install the package
2525N/Aduring an update unless it becomes required by another dependency; in
2525N/Athat case, if the package is no longer required after a subsequent
2525N/Aoperation it is removed. A good example of how to use these
2525N/Adependencies is to construct packages containing group dependencies on
2525N/Apackages that are needed for typical uses of a system. Some examples
2525N/Amight be 'end-user-desktop' or 'developer' or 'nfs-server' and the
2525N/Alike; the administrator could install all that apply and know that
2525N/Aover subsequent updates to newer versions of Solaris, the appropriate
2525N/Apackages would be added to his system.
2573N/AThe ``origin`` dependency exists to resolve upgrade issues that require
2525N/Aintermediate transitions. The default behavior is to specify the
2573N/Aminimum version of a package (if installed) that must be present on
2525N/Athe system being updated. For example, a typical use might be a
2525N/Adatabase package version 5 that supports upgrade from version 3 or
2525N/Agreater, but not earlier versions. In this case, version 5 would have
2525N/Aan origin dependency on itself at version 3. Thus, version 5 was
2525N/Abeing fresh installed, installation would proceed; but if version 1 of
2525N/Athe package was installed, one could not upgrade directly to this
2525N/Aversion. Thus, pkg update database-package would not select version 5
2525N/Ain this case but would pick version 3 instead as the latest possible
2525N/Aversion it could install. The behavior of this dependency may be
2525N/Amodified by the 'root-image' attribute being set to true; in this
2525N/Acase the named package must be at the specified version or greater
2525N/Aif it is present in the running system, rather than the image
2525N/Abeing updated. This is generally used for operating system
2525N/Aissues such as dependencies on boot block installers and the like.
2573N/AThe ``parent`` dependency is used for zones or other child images. In
2525N/Athis case, the dependency is only checked in a zone, and specifies a
2525N/Apackage and version that must be present in the parent image or global
2525N/Azone. The version specified must match to the level of precision
2573N/Aspecified. For example, if the ``parent`` dependency is on A@2.1, then
2573N/Aany version of A beginning with 2.1. will match. This dependency is
2525N/Aoften used to require that packages are kept in sync between local
2525N/Azones and the global zone, and as a short cut a special package name
2525N/Aversion of the package that contains it. This is used to keep key
2525N/Asynchronized with the kernel installed in the global zone.
2573N/AThe ``incorporate`` dependency is heavily used in Solaris to insure that
2525N/Acompatible versions of software are installed together. The basic
2573N/Amechanism is like that of an ``optional`` dependency, except that the
2573N/Aversion matching is that of the ``parent`` dependency: if this package
2525N/Ais present, it must be at the specified version to the level
2525N/Aspecified. How these dependencies are typically used is that many of
2525N/Athem are placed in the same package to define a surface in the package
2525N/Aversion space that is compatible. Packages that contain such sets of
2573N/Aincorporate dependencies are often called *incorporations*; it is
2525N/Atypical to define such for sets of software packages that are built
2525N/Atogether and are not separately versioned, like much of the kernel.
2573N/AThe ``exclude`` dependency is seldom used. It allows the containing
2525N/Apackage to preclude installation with the specified package at the
2525N/Aspecified version or higher. Note that if the version is omitted, no
2525N/Aversion of the specified package may be installed with the containing
2525N/Apackage. These constraints can be frustrating to administrators,
2525N/Aand should be avoided where possible.
2573N/AXXX Chapter 3 talks about Constraints and Freezing when discussing the
2573N/Adepend chapter, and references this chapter. Chapter 13 talks
2573N/Aabout how to create working package sets in Solaris. Either here,
2573N/Aor in Chapter 13, we ought to have a discussion about how to create