Cross Reference: /pkg/doc/dev-guide/chpt6.txt
chpt6.txt revision 2573
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
2573N/A.. CDDL HEADER START
2573N/A
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
2573N/A.. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2573N/A or http://www.opensolaris.org/os/licensing.
2573N/A See the License for the specific language governing permissions
2573N/A and limitations under the License.
2573N/A
2573N/A.. When distributing Covered Code, include this CDDL HEADER in each
2573N/A file and include the License file at usr/src/OPENSOLARIS.LICENSE.
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
2573N/A.. CDDL HEADER END
2573N/A
2573N/A.. Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2573N/A
2573N/AChapter 6
2573N/A---------
2573N/A
2573N/ADependencies
2573N/A............
2525N/A
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.
2525N/A
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/A
2525N/ADependency Types
2573N/A~~~~~~~~~~~~~~~~
2573N/A
2573N/A
2573N/Arequire
2573N/A```````
2525N/A
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.
2525N/A
2573N/Arequire-any
2573N/A```````````
2573N/A
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 ``require`` dependency.
2525N/A
2573N/Aoptional
2573N/A````````
2573N/A
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.
2525N/A
2573N/Aconditional
2573N/A```````````
2573N/A
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.
2525N/A
2573N/Agroup
2573N/A`````
2573N/A
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.
2525N/A
2573N/Aorigin
2573N/A``````
2573N/A
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.
2525N/A
2573N/Aparent
2573N/A``````
2573N/A
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
2573N/A``feature/package/dependency/self`` is used as a synonym for the exact
2525N/Aversion of the package that contains it. This is used to keep key
2525N/Aoperating system components, such as libc.so.1 installed in the zone
2525N/Asynchronized with the kernel installed in the global zone.
2525N/A
2573N/Aincorporate
2573N/A```````````
2573N/A
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.
2525N/A
2573N/Aexclude
2573N/A```````
2573N/A
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.
2525N/A
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
2573N/Aincorporations, how to use facet.version-lock.* on incorporate
2573N/Adependencies, etc.
2525N/A