summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/pod/OpenBSD::PackingElement.pod
blob: 8a3e8591548890c894ce66757e3a16d90999aff9 (plain)
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
$OpenBSD: OpenBSD::PackingElement.pod,v 1.2 2005/03/04 11:24:35 espie Exp $

=head1 NAME

OpenBSD::PackingElement - C<pkg_add(1)> packing-elements object hierarchy

=head1 SYNOPSIS

    package OpenBSD::PackingElement;
    sub method
    {
    }

    package OpenBSD::PackingElement::Depend;
    sub method
    {
    	my ($self, $args) = @_;
	# do something
    }

    package main;
    use OpenBSD::PackingList;

    $plist = OpenBSD::PackingList->fromfile($filename);
    $plist->visit('method', @args);

=head1 DESCRIPTION

C<OpenBSD::PackingElement> is the base class for all elements in a 
packing-list (see L<OpenBSD::PackingList> and C<pkg_create(1)>).

Manipulation of packing-lists mostly occurs through visitor patterns
such as C<OpenBSD::PackingList::visit>: client code defines a method for
each relevant class in the hierarchy and calls C<$plist-E<gt>visit('method')>
to perform the processing.

Most actual objects have one property: their C<name>.

=over 4

=item ::Meta

base class for all meta information that can be reordered at will.

=over 4

=item ::Unique

meta information with uniqueness properties.

=over 4

=item ::Arch

architecture requirements.

=item ::ExtraInfo

some unique properties, like C<PKGPATH> and ftp status.

=item ::Name

the package name.

=item ::LocalBase

the local base for the package.

=item ::NoDefaultConflict

special annotation that package should not have any C<stem-*> conflict marker.

=back

=item ::Option

factory for C<@option>

=item ::Comment

comments in the packing-lists. The constructor is actually a factory,
since some comments evolve to some other class.

=item ::CVSTag

special class of comments that get reordered to the front of packing-lists.

=item ::Depend

all dependency information.

=over 4

=item ::PkgDep

deprecated

=item ::NewDepend

deprecated

=item ::LibDepend

deprecated

=item ::Wantlib

shared library needed for the package.

=item ::Dependency

package needed.

=back

=item ::Conflict

conflict information.

=over 4

=item ::PkgConflict

deprecated.

=back

=item ::Annotation

stuff that doesn't really exist as objects, but is used to add
properties to objects.

=over 4

=item ::Ignore

mark next object as ignored.

=item ::md5

mark last file with a checksum.

=item ::size

mark last file with a size.

=item ::symlink

mark last file as a symlink.

=item ::hardlink

mark last file as a hardlink.

=item ::temp

mark last file with a temporary name. Used during extraction of
packages for replacement.

=back

=item ::Object

somewhat concrete elements in packing-lists.
This is the base class for objects with a location in the filesystem.
It defineds method C<fullname>, to access the complete name of the object.

=over 4

=item ::FileObject

abstract class corresponding to files and directories.
Default constructor depends on a C<dirclass> property, that may
create objects from another class if their name ends with a C</>.
The full object name is normally computed relative to the current 
working directory as set in C<::State>.

=over 4

=item ::FileBase

abstract class for files.

=over 4

=item ::File

actual file objects present in the packing-list.

=item ::InfoFile

GNU info file objects.

=item ::Shell

files with shell properties.

=item ::Manpage

man pages.

=item ::Lib

shared library files.

=item ::Sample

file objects not present in the packing-list.

=back

=item ::DirlikeObject

abstract class for directories.

=over 4

=item ::DirRm

=item ::DirBase

=over 4

=item ::Dir

=over 4

=item ::Infodir

=item ::Fontdir

=item ::Mandir

=back

=back

=back

=item ::Action

stuff that performs some action during addition/removal of package.

=over 4

=item ::NewUser

user that needs to be created for the package to work.

=item ::NewGroup

group that needs to be created for the package to work.

=item ::Sysctl

C<sysctl(8)> property needed for the package to work.

=item ::ExeclikeAction

escape mechanism for extra code that needs to be run.

=over 4

=item ::Exec

=item ::Unexec

=item ::Extraunexec

=back

=back

=item ::State

annotation-like stuff that can't be easily moved around because it influences
surrounding objects.

=over 4

=item ::Cwd

=item ::EndFake

=item ::Owner

=item ::Group

=item ::Mode

=back

=back

=back

=head1 CAVEATS

Some aspects of this API are likely to change in the future, although the
basic class hierarchy is now more or less worked out.