summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/pod/OpenBSD::PackingElement.pod
blob: b75da8a760a7f6e597f95774b081d27d694f84e0 (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
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
$OpenBSD: OpenBSD::PackingElement.pod,v 1.13 2017/03/03 18:29:07 bluhm 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(3p)> 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 allowed-for-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.

=item ::SpecialFile

special files like the package description or install script.

=over 4

=item ::FCONTENTS

contents file.

=item ::FDESC

package description.

=item ::DisplayFile

abstract class for special files that can be displayed.
provides method C<prepare($state)> to display the file.

=over 4

=item ::FDISPLAY

message displayed during package install.

=item ::FUNDISPLAY

message displayed during package uninstall.

=back

=back

=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 ::Wantlib

shared library needed for the package.

=item ::Dependency

package needed, with the following properties: C<pkgpath> is the path
used to create the dependency, C<pattern> is the L<OpenBSD::PkgSpec(3p)>
pattern used to match the dependency, C<def> is the default value of
the dependency computed during build, to use for comparing package signatures
and to fullfill default dependencies.

=back

=item ::Conflict

conflict information.

=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 ::sha

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.

Note that all objects with file names use relative names except for
C<::Extra>, C<::Sample> and C<::Sampledir>

=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.

=for comment  ::Extra and ::Extradir intentionally not documented yet.

=back

=item ::DirlikeObject

abstract class for directories.

=over 4

=item ::DirRm

deprecated.

=item ::DirBase

=over 4

=item ::Dir

normal directory, with specialized versions.

=over 4

=item ::Infodir

directory holds GNU info files.

=item ::Fontdir

directory holds X11 fonts.

=item ::Mandir

directory is the root of a set of manpages.

=item ::Sampledir

directory is used to hold configuration files or similar objects.

=back

=back

=back

=back

=item ::Action

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

=over 4

=item ::NewAuth

=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.

=back

=item ::ExeclikeAction

escape mechanism for embedded code that needs to be run.

=over 4

=item ::Exec

code to run during installation.

=item ::Unexec

code to run during deinstallation.

=item ::Extraunexec

extra code to run during deinstallation with -c.

=back

=back

=item ::State

annotation-like stuff that can't be easily moved around because it influences
surrounding objects (mostly derived from C<::FileObject>).

=over 4

=item ::Cwd

change the current working directory.

=item ::Owner

change the current file owner.

=item ::Group

change the current file group.

=item ::Mode

change the current file 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.