~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to Perl-RPM/RPM/Constants.pm

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
###############################################################################
 
2
#
 
3
#   (c) Copyright @ 2000, Randy J. Ray <rjray@blackperl.com>
 
4
#               All Rights Reserved
 
5
#
 
6
###############################################################################
 
7
#
 
8
#   $Id: Constants.pm,v 1.18 2001/04/27 09:05:21 rjray Exp $
 
9
#
 
10
#   Description:    Constants for the RPM package
 
11
#
 
12
#   Functions:      None-- constants are implemented as pseudo-functions
 
13
#
 
14
#   Libraries:      RPM (to force bootstrapping)
 
15
#
 
16
###############################################################################
 
17
 
 
18
package RPM::Constants;
 
19
 
 
20
use strict;
 
21
use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS $VERSION $AUTOLOAD);
 
22
 
 
23
require Exporter;
 
24
 
 
25
use RPM;
 
26
 
 
27
@ISA = qw(Exporter);
 
28
 
 
29
$VERSION = do { my @r=(q$Revision: 1.18 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r };
 
30
 
 
31
@EXPORT_OK = qw(
 
32
                CHECKSIG_GPG
 
33
                CHECKSIG_MD5
 
34
                CHECKSIG_PGP
 
35
                INSTALL_HASH
 
36
                INSTALL_LABEL
 
37
                INSTALL_NODEPS
 
38
                INSTALL_NOORDER
 
39
                INSTALL_PERCENT
 
40
                INSTALL_UPGRADE
 
41
                QUERY_FOR_CONFIG
 
42
                QUERY_FOR_DOCS
 
43
                QUERY_FOR_DUMPFILES
 
44
                QUERY_FOR_LIST
 
45
                QUERY_FOR_STATE
 
46
                RPM_NULL_TYPE
 
47
                RPM_CHAR_TYPE
 
48
                RPM_INT8_TYPE
 
49
                RPM_INT16_TYPE
 
50
                RPM_INT32_TYPE
 
51
                RPM_STRING_TYPE
 
52
                RPM_BIN_TYPE
 
53
                RPM_STRING_ARRAY_TYPE
 
54
                RPM_I18NSTRING_TYPE
 
55
                RPMERR_BADARG
 
56
                RPMERR_BADDEV
 
57
                RPMERR_BADFILENAME
 
58
                RPMERR_BADMAGIC
 
59
                RPMERR_BADRELOCATE
 
60
                RPMERR_BADSIGTYPE
 
61
                RPMERR_BADSPEC
 
62
                RPMERR_CHOWN
 
63
                RPMERR_CPIO
 
64
                RPMERR_CREATE
 
65
                RPMERR_DBCORRUPT
 
66
                RPMERR_DBGETINDEX
 
67
                RPMERR_DBOPEN
 
68
                RPMERR_DBPUTINDEX
 
69
                RPMERR_EXEC
 
70
                RPMERR_FILECONFLICT
 
71
                RPMERR_FLOCK
 
72
                RPMERR_FORK
 
73
                RPMERR_GDBMOPEN
 
74
                RPMERR_GDBMREAD
 
75
                RPMERR_GDBMWRITE
 
76
                RPMERR_GZIP
 
77
                RPMERR_INTERNAL
 
78
                RPMERR_LDD
 
79
                RPMERR_MKDIR
 
80
                RPMERR_MTAB
 
81
                RPMERR_NEWPACKAGE
 
82
                RPMERR_NOCREATEDB
 
83
                RPMERR_NOGROUP
 
84
                RPMERR_NORELOCATE
 
85
                RPMERR_NOSPACE
 
86
                RPMERR_NOSPEC
 
87
                RPMERR_NOTSRPM
 
88
                RPMERR_NOUSER
 
89
                RPMERR_OLDDB
 
90
                RPMERR_OLDDBCORRUPT
 
91
                RPMERR_OLDDBMISSING
 
92
                RPMERR_OLDPACKAGE
 
93
                RPMERR_PKGINSTALLED
 
94
                RPMERR_READERROR
 
95
                RPMERR_RENAME
 
96
                RPMERR_RMDIR
 
97
                RPMERR_RPMRC
 
98
                RPMERR_SCRIPT
 
99
                RPMERR_SIGGEN
 
100
                RPMERR_STAT
 
101
                RPMERR_UNKNOWNARCH
 
102
                RPMERR_UNKNOWNOS
 
103
                RPMERR_UNLINK
 
104
                RPMERR_UNMATCHEDIF
 
105
                RPMFILE_CONFIG
 
106
                RPMFILE_DOC
 
107
                RPMFILE_DONOTUSE
 
108
                RPMFILE_GHOST
 
109
                RPMFILE_LICENSE
 
110
                RPMFILE_MISSINGOK
 
111
                RPMFILE_NOREPLACE
 
112
                RPMFILE_README
 
113
                RPMFILE_SPECFILE
 
114
                RPMFILE_STATE_NETSHARED
 
115
                RPMFILE_STATE_NORMAL
 
116
                RPMFILE_STATE_NOTINSTALLED
 
117
                RPMFILE_STATE_REPLACED
 
118
                RPMPROB_FILTER_DISKSPACE
 
119
                RPMPROB_FILTER_FORCERELOCATE
 
120
                RPMPROB_FILTER_IGNOREARCH
 
121
                RPMPROB_FILTER_IGNOREOS
 
122
                RPMPROB_FILTER_OLDPACKAGE
 
123
                RPMPROB_FILTER_REPLACENEWFILES
 
124
                RPMPROB_FILTER_REPLACEOLDFILES
 
125
                RPMPROB_FILTER_REPLACEPKG
 
126
                RPMSENSE_EQUAL
 
127
                RPMSENSE_GREATER
 
128
                RPMSENSE_LESS
 
129
                RPMSENSE_OBSOLETES
 
130
                RPMSENSE_PREREQ
 
131
                RPMSENSE_SENSEMASK
 
132
                RPMSENSE_TRIGGER
 
133
                RPMSENSE_TRIGGERIN
 
134
                RPMSENSE_TRIGGERPOSTUN
 
135
                RPMSENSE_TRIGGERUN
 
136
                RPMSIGTAG_GPG
 
137
                RPMSIGTAG_LEMD5_1
 
138
                RPMSIGTAG_LEMD5_2
 
139
                RPMSIGTAG_MD5
 
140
                RPMSIGTAG_PGP
 
141
                RPMSIGTAG_PGP5
 
142
                RPMSIGTAG_SIZE
 
143
                RPMSIG_BAD
 
144
                RPMSIG_NOKEY
 
145
                RPMSIG_NOTTRUSTED
 
146
                RPMSIG_OK
 
147
                RPMSIG_UNKNOWN
 
148
                RPMTAG_ARCH
 
149
                RPMTAG_ARCHIVESIZE
 
150
                RPMTAG_BASENAMES
 
151
                RPMTAG_BUILDARCHS
 
152
                RPMTAG_BUILDHOST
 
153
                RPMTAG_BUILDMACROS
 
154
                RPMTAG_BUILDROOT
 
155
                RPMTAG_BUILDTIME
 
156
                RPMTAG_CAPABILITY
 
157
                RPMTAG_CHANGELOGNAME
 
158
                RPMTAG_CHANGELOGTEXT
 
159
                RPMTAG_CHANGELOGTIME
 
160
                RPMTAG_CONFLICTFLAGS
 
161
                RPMTAG_CONFLICTNAME
 
162
                RPMTAG_CONFLICTVERSION
 
163
                RPMTAG_COPYRIGHT
 
164
                RPMTAG_COOKIE
 
165
                RPMTAG_DESCRIPTION
 
166
                RPMTAG_DIRINDEXES
 
167
                RPMTAG_DIRNAMES
 
168
                RPMTAG_DISTRIBUTION
 
169
                RPMTAG_EXCLUDEARCH
 
170
                RPMTAG_EXCLUDEOS
 
171
                RPMTAG_EXCLUSIVEARCH
 
172
                RPMTAG_EXCLUSIVEOS
 
173
                RPMTAG_FILEDEVICES
 
174
                RPMTAG_FILEFLAGS
 
175
                RPMTAG_FILEGROUPNAME
 
176
                RPMTAG_FILEINODES
 
177
                RPMTAG_FILELANGS
 
178
                RPMTAG_FILELINKTOS
 
179
                RPMTAG_FILEMD5S
 
180
                RPMTAG_FILEMODES
 
181
                RPMTAG_FILEMTIMES
 
182
                RPMTAG_FILERDEVS
 
183
                RPMTAG_FILESIZES
 
184
                RPMTAG_FILESTATES
 
185
                RPMTAG_FILEUSERNAME
 
186
                RPMTAG_FILEVERIFYFLAGS
 
187
                RPMTAG_GIF
 
188
                RPMTAG_GROUP
 
189
                RPMTAG_ICON
 
190
                RPMTAG_INSTALLTIME
 
191
                RPMTAG_INSTPREFIXES
 
192
                RPMTAG_LICENSE
 
193
                RPMTAG_NOPATCH
 
194
                RPMTAG_NOSOURCE
 
195
                RPMTAG_NAME
 
196
                RPMTAG_OBSOLETEFLAGS
 
197
                RPMTAG_OBSOLETENAME
 
198
                RPMTAG_OBSOLETEVERSION
 
199
                RPMTAG_OS
 
200
                RPMTAG_PACKAGER
 
201
                RPMTAG_PATCH
 
202
                RPMTAG_POSTIN
 
203
                RPMTAG_POSTINPROG
 
204
                RPMTAG_POSTUN
 
205
                RPMTAG_POSTUNPROG
 
206
                RPMTAG_PREFIXES
 
207
                RPMTAG_PREIN
 
208
                RPMTAG_PREINPROG
 
209
                RPMTAG_PREUN
 
210
                RPMTAG_PREUNPROG
 
211
                RPMTAG_PROVIDEFLAGS
 
212
                RPMTAG_PROVIDENAME
 
213
                RPMTAG_PROVIDEVERSION
 
214
                RPMTAG_RELEASE
 
215
                RPMTAG_REQUIREFLAGS
 
216
                RPMTAG_REQUIRENAME
 
217
                RPMTAG_REQUIREVERSION
 
218
                RPMTAG_RPMVERSION
 
219
                RPMTAG_SIZE
 
220
                RPMTAG_SOURCE
 
221
                RPMTAG_SOURCERPM
 
222
                RPMTAG_SUMMARY
 
223
                RPMTAG_TRIGGERCONDS
 
224
                RPMTAG_TRIGGERFLAGS
 
225
                RPMTAG_TRIGGERINDEX
 
226
                RPMTAG_TRIGGERNAME
 
227
                RPMTAG_TRIGGERSCRIPTPROG
 
228
                RPMTAG_TRIGGERSCRIPTS
 
229
                RPMTAG_TRIGGERVERSION
 
230
                RPMTAG_URL
 
231
                RPMTAG_VENDOR
 
232
                RPMTAG_VERIFYSCRIPT
 
233
                RPMTAG_VERIFYSCRIPTPROG
 
234
                RPMTAG_VERSION
 
235
                RPMTAG_XPM
 
236
                RPMTRANS_FLAG_ALLFILES
 
237
                RPMTRANS_FLAG_BUILD_PROBS
 
238
                RPMTRANS_FLAG_JUSTDB
 
239
                RPMTRANS_FLAG_KEEPOBSOLETE
 
240
                RPMTRANS_FLAG_NODOCS
 
241
                RPMTRANS_FLAG_NOSCRIPTS
 
242
                RPMTRANS_FLAG_NOTRIGGERS
 
243
                RPMTRANS_FLAG_TEST
 
244
                RPMVERIFY_ALL
 
245
                RPMVERIFY_FILESIZE
 
246
                RPMVERIFY_GROUP
 
247
                RPMVERIFY_LINKTO
 
248
                RPMVERIFY_LSTATFAIL
 
249
                RPMVERIFY_MD5
 
250
                RPMVERIFY_MODE
 
251
                RPMVERIFY_MTIME
 
252
                RPMVERIFY_NONE
 
253
                RPMVERIFY_RDEV
 
254
                RPMVERIFY_READFAIL
 
255
                RPMVERIFY_READLINKFAIL
 
256
                RPMVERIFY_USER
 
257
                UNINSTALL_ALLMATCHES
 
258
                UNINSTALL_NODEPS
 
259
                VERIFY_DEPS
 
260
                VERIFY_FILES
 
261
                VERIFY_MD5
 
262
                VERIFY_SCRIPT
 
263
               );
 
264
 
 
265
#
 
266
# To create the %EXPORT_TAGS table, we're going to create a temp hash with
 
267
# the tags broken down into groupings. Then when the "known" groupings are
 
268
# done, whatever is left can go in "misc"
 
269
#
 
270
my %groups = ();
 
271
my %consts = map { $_, 1 } @EXPORT_OK;
 
272
for my $group (qw(install query rpmerr rpmfile rpmlead rpmmess rpmprob_filter
 
273
                  rpmsense rpmsigtag rpmsig rpmtag rpmtrans_flag
 
274
                  rpmverify uninstall verify))
 
275
{
 
276
    my $pat = qr/^$group/i;
 
277
    my $list = [];
 
278
 
 
279
    for (grep($_ =~ $pat, sort keys %consts))
 
280
    {
 
281
        push(@$list, $_);
 
282
        delete $consts{$_};
 
283
    }
 
284
 
 
285
    $groups{$group} = $list;
 
286
}
 
287
 
 
288
# Types didn't fit neatly into the above logic-loop
 
289
$groups{rpmtype} = [];
 
290
for (grep($_ =~ /^RPM_.*_TYPE/, sort keys %consts))
 
291
{
 
292
    push(@{$groups{rpmtype}}, $_);
 
293
    delete $consts{$_};
 
294
}
 
295
 
 
296
# Pick up any stragglers
 
297
$groups{misc} = [ sort keys %consts ];
 
298
 
 
299
# Merge the install and uninstall groups
 
300
push(@{$groups{install}}, @{$groups{uninstall}});
 
301
delete $groups{uninstall};
 
302
 
 
303
%EXPORT_TAGS = (
 
304
                all => [ @EXPORT_OK ],
 
305
                %groups
 
306
               );
 
307
 
 
308
sub AUTOLOAD
 
309
{
 
310
    my $constname;
 
311
    ($constname = $AUTOLOAD) =~ s/.*:://;
 
312
    die "& not defined" if $constname eq 'constant';
 
313
    my $val = constant($constname);
 
314
    if ($! != 0)
 
315
    {
 
316
        die "Your vendor has not defined RPM macro $constname";
 
317
    }
 
318
    no strict 'refs';
 
319
    *$AUTOLOAD = sub { $val };
 
320
    goto &$AUTOLOAD;
 
321
}
 
322
 
 
323
1;
 
324
 
 
325
__END__
 
326
 
 
327
=head1 NAME
 
328
 
 
329
RPM::Constants - Groups of RPM-defined symbols
 
330
 
 
331
=head1 SYNOPSIS
 
332
 
 
333
    use RPM::Constants qw(:rpmerr :rpmtype);
 
334
 
 
335
=head1 DESCRIPTION
 
336
 
 
337
This package is a collection of the constants defined by B<rpm> itself that
 
338
may be of use to those developing with the B<RPM> Perl bindings.
 
339
 
 
340
=head1 GROUPS
 
341
 
 
342
For ease of use and uderstanding (at last count, the total number of
 
343
constants was 232), the constants are broken up into several smaller groups:
 
344
 
 
345
=head2 Header Tag Identifiers
 
346
 
 
347
The following symbols may be imported via the tag B<:rpmtag>, and represent
 
348
the various elements that may be present in a package header. When used to
 
349
retrieve data from a header as a hash key, the C<RPMTAG_> portion should be
 
350
omitted from the name. Use the full name only when referring to the constant.
 
351
Note that each name is followed by either a C<$> or a C<@>. This signifies
 
352
the return type of the data; a scalar or an array reference. In all cases, a
 
353
failed operation is noted by a return value of C<undef>.
 
354
 
 
355
The majority of the tags that return list references in fact refer to the
 
356
ordered list of files present in the C<BASENAMES> tag. In these cases (such
 
357
as C<MD5SUMS>), the value of the array at a given point may be null if it
 
358
is not relevant. That is because the C<BASENAMES> array (and thus all other
 
359
file-related lists) must accomodate the indices at which a directory name is
 
360
specified for the sake of defining the directory. In such cases, values such
 
361
as size or MD5 checksum have no direct relevance.
 
362
 
 
363
=over
 
364
 
 
365
=item RPMTAG_ARCH ($)
 
366
 
 
367
Name of the architecture that the package was built for. If the package
 
368
is architecture-independant, the value should read "noarch".
 
369
 
 
370
=item RPMTAG_ARCHIVESIZE ($)
 
371
 
 
372
Size of the archive portion of the file. B<RPM> stores the archive portion
 
373
of a (non-source) package as a B<cpio> archive, which may also be compressed
 
374
internally. Thus, this value is generally larger than the file size of the
 
375
C<RPM> file itself.
 
376
 
 
377
=item RPMTAG_BASENAMES (@)
 
378
 
 
379
A list of the base (leaf) names of the files contained within the package.
 
380
These are combined with the values from B<RPMTAG_DIRNAMES> using a mapping
 
381
provided by B<RPMTAG_DIRINDEXES>.
 
382
 
 
383
This is actually a very key tag within a header. Many of the list-returning
 
384
tags documented further down maintain a one-to-one correlation with the
 
385
elements in this array.
 
386
 
 
387
=item RPMTAG_BUILDARCHS (@)
 
388
 
 
389
Not entirely sure. Appears from source code examples to be a list of those
 
390
architectures for which a package should be built. All examples from the set
 
391
of SRPMs in Red Hat Linux 6.2 only use this tag when the only value is
 
392
C<noarch>.
 
393
 
 
394
=item RPMTAG_BUILDHOST ($)
 
395
 
 
396
Name of the host the package was built on.
 
397
 
 
398
=item RPMTAG_BUILDMACROS (@)
 
399
 
 
400
This does not seem to be used in the library. It may be present for future
 
401
expansion use.
 
402
 
 
403
=item RPMTAG_BUILDROOT ($)
 
404
 
 
405
Specifies the root at which the package is built.
 
406
 
 
407
=item RPMTAG_BUILDTIME ($)
 
408
 
 
409
The time/date when the package was created, expressed as a C<time()> value
 
410
(seconds since the epoch).
 
411
 
 
412
=item RPMTAG_CHANGELOGNAME (@)
 
413
 
 
414
=item RPMTAG_CHANGELOGTEXT (@)
 
415
 
 
416
=item RPMTAG_CHANGELOGTIME (@)
 
417
 
 
418
These three items should be taken together. Each should have the same number
 
419
of items, and the items at corresponding indices should be taken together.
 
420
Taken this way, they provide a small-scale changelog for the package, detailing
 
421
the name of the person making the entry, the text of the entry and the time
 
422
of the entry, in the respective order given above.
 
423
 
 
424
=item RPMTAG_CONFLICTFLAGS (@)
 
425
 
 
426
=item RPMTAG_CONFLICTNAME (@)
 
427
 
 
428
=item RPMTAG_CONFLICTVERSION (@)
 
429
 
 
430
These three items are used in conjunction to specify packages and/or
 
431
individual files which the package itself would conflict with. Of the three,
 
432
only B<RPMTAG_CONFLICTNAME> is required to have data in all elements of
 
433
the array.  The other two will have the same number of elements, though some
 
434
(or most) may be null. This is the same approach as is used to specify the
 
435
elements that the package obsoletes, those the package provides and those
 
436
the package requires (see L<"Three-Part Linkage"> below).
 
437
 
 
438
=item RPMTAG_COPYRIGHT
 
439
 
 
440
Maintained by RPM for backwards-compatibility with some older packages. It
 
441
is the same as C<RPMTAG_LICENSE>.
 
442
 
 
443
=item RPMTAG_COOKIE ($)
 
444
 
 
445
A simple tag, a single text string, added at the time the RPM is created.
 
446
Generally, it is created from the hostname on which the package is built
 
447
and the UNIX C<time()> value at the time of packaging.
 
448
 
 
449
=item RPMTAG_DESCRIPTION ($)
 
450
 
 
451
A textual description of the package.
 
452
 
 
453
=item RPMTAG_DIRINDEXES (@)
 
454
 
 
455
This data should have a one-to-one correspondance with B<RPMTAG_BASENAMES>,
 
456
above. Each item here is a numerical index into the list of directories named
 
457
in B<RPMTAG_DIRNAMES> below. It indicates which of the directories is to be
 
458
prepended to the corresponding base file name in order to create the full
 
459
pathname.
 
460
 
 
461
=item RPMTAG_DIRNAMES (@)
 
462
 
 
463
This is a list of all directories into which the package would install files.
 
464
This list is used with B<RPMTAG_BASENAMES> to create full paths, indexed by
 
465
way of B<RPMTAG_DIRINDEXES> above.
 
466
 
 
467
=item RPMTAG_DISTRIBUTION ($)
 
468
 
 
469
A text label identifying the name given to the overall larger distribution
 
470
the package itself is a part of.
 
471
 
 
472
=item RPMTAG_EXCLUDEARCH (@)
 
473
 
 
474
A list of architectures for which the package should not be built.
 
475
 
 
476
=item RPMTAG_EXCLUDEOS (@)
 
477
 
 
478
A list of operating systems for which the package should not be built.
 
479
 
 
480
=item RPMTAG_EXCLUSIVEARCH (@)
 
481
 
 
482
A list of architectures only for which the package should be built.
 
483
 
 
484
=item RPMTAG_EXCLUSIVEOS (@)
 
485
 
 
486
A list of operating systems only for which the package should be built.
 
487
 
 
488
=item RPMTAG_FILEDEVICES (@)
 
489
 
 
490
The integer device values (from the B<stat> system call) for each file in
 
491
the package.
 
492
 
 
493
=item RPMTAG_FILEFLAGS (@)
 
494
 
 
495
A bit-field with zero or more of the flags defined below under the heading
 
496
of I<rpmfile>. See the flags themselves for more detail.
 
497
 
 
498
=item RPMTAG_FILEGROUPNAME (@)
 
499
 
 
500
A string-array data field that contains the group ID (by name) that should
 
501
be used for setting group ownership of the files contained in the package.
 
502
There should be a one-to-one correspondance between this list and the list of
 
503
files in C<RPMTAG_BASENAMES>. See also C<RPMTAG_USERNAME>.
 
504
 
 
505
=item RPMTAG_FILEINODES (@)
 
506
 
 
507
The C<inode> (from the B<stat> system call) that each file in
 
508
the package had on the system on which the package was built.
 
509
 
 
510
=item RPMTAG_FILELANGS (@)
 
511
 
 
512
Used to specify language-specific files, which may then be marked for skipping
 
513
based on the list of accepted languages at install-time.
 
514
 
 
515
=item RPMTAG_FILELINKTOS (@)
 
516
 
 
517
A list of names with exactly as many elements as there are filenames; each
 
518
slot in this list is either empty, or (if not) gives the name of a file that
 
519
the current filename should be made as a symbolic link to.
 
520
 
 
521
=item RPMTAG_FILEMD5S (@)
 
522
 
 
523
MD5 checksums for each file in the package.
 
524
 
 
525
=item RPMTAG_FILEMODES (@)
 
526
 
 
527
The file-modes as integer values, for each file in the package.
 
528
 
 
529
=item RPMTAG_FILEMTIMES (@)
 
530
 
 
531
The integer modification-time (from the B<stat> system call) for each file in
 
532
the package.
 
533
 
 
534
=item RPMTAG_FILERDEVS (@)
 
535
 
 
536
The integer C<rdev> values (from the B<stat> system call) for each file in
 
537
the package.
 
538
 
 
539
=item RPMTAG_FILESIZES (@)
 
540
 
 
541
The size (in bytes) of each file in the package.
 
542
 
 
543
=item RPMTAG_FILESTATES (@)
 
544
 
 
545
A list of file-state information for each file in the package. References
 
546
the constants defined below under the heading of C<rpmfile_states>.
 
547
 
 
548
=item RPMTAG_FILEUSERNAME (@)
 
549
 
 
550
A string-array data field that contains the user ID (by name) that should
 
551
be used for setting ownership of the files contained in the package. There
 
552
should be a one-to-one correspondance between this list and the list of
 
553
files in C<RPMTAG_BASENAMES>. See also C<RPMTAG_GROUPNAME>.
 
554
 
 
555
=item RPMTAG_FILEVERIFYFLAGS (@)
 
556
 
 
557
A list of flags (implemented as a bit-field within an integer) for each file
 
558
in the archive, specifying what should be checked during the verification
 
559
stage. See the B<RPMVERIFY_*> constants below.
 
560
 
 
561
=item RPMTAG_GIF ($)
 
562
 
 
563
Similar to B<RPMTAG_ICON> defined below, with the restriction that the file
 
564
specified should in fact be a GIF image.
 
565
 
 
566
=item RPMTAG_GROUP ($)
 
567
 
 
568
A one-line text string that places the package within the overall hierarchy
 
569
of packages, using a UNIX-style format of denoting level with forward-slash
 
570
characters (C</>). Most packages will have at least two elements separated by
 
571
one such slash, though more are possible (as is a top-level name).
 
572
 
 
573
=item RPMTAG_ICON ($)
 
574
 
 
575
Specifies a file within a source-RPM (SRPM) that should be treated as an icon
 
576
(of either GIF or XPM format), for potential use by GUI-based RPM tools.
 
577
See C<RPMTAG_XPM> below and C<RPMTAG_GIF> above.
 
578
 
 
579
=item RPMTAG_INSTALLTIME ($)
 
580
 
 
581
The time at which the package was installed on your system. Should only be
 
582
present in header objects from the database, not from uninstalled packages.
 
583
 
 
584
=item RPMTAG_INSTPREFIXES (@)
 
585
 
 
586
Specifies one or more prefixes that are set to the environment variables,
 
587
C<RPM_INSTALL_PREFIX{n}>, where C<{n}> is a number starting from zero. These
 
588
are set before executing any of the scripts (pre- or post-install, or verify).
 
589
 
 
590
=item RPMTAG_LICENSE ($)
 
591
 
 
592
The license and/or restrictions under which the package is distributed.
 
593
 
 
594
=item RPMTAG_NAME ($)
 
595
 
 
596
The name of the package. This is the first part of a triple used to uniquely
 
597
identify a given package. It is used in conjunction with B<RPMTAG_VERSION>
 
598
and B<RPMTAG_RELEASE>, in that order.
 
599
 
 
600
=item RPMTAG_NOPATCH (@)
 
601
 
 
602
=item RPMTAG_NOSOURCE (@)
 
603
 
 
604
These are used to list elements that should not be included in the resulting
 
605
SRPM when it is built from a spec-file. The lists provided by the B<SOURCE>
 
606
and B<PATCH> tags provide all elements as itemized in the spec-file. However,
 
607
if either of these tags are also present, then some elements may not actually
 
608
exist in the package. Both of these refer to entries in the corresponding
 
609
list of names by numberical index (starting at 0).
 
610
 
 
611
=item RPMTAG_OBSOLETEFLAGS (@)
 
612
 
 
613
=item RPMTAG_OBSOLETENAME (@)
 
614
 
 
615
=item RPMTAG_OBSOLETEVERSION (@)
 
616
 
 
617
These three items are used in conjunction to specify packages and/or
 
618
individual files which the package itself obsoletes. Of the three, only
 
619
B<RPMTAG_OBSOLETENAME> is required to have data in all elements of the array.
 
620
The other two will have the same number of elements, though some (or most)
 
621
may be null. This is the same approach as is used to specify the elements
 
622
that the package conflicts with, those the package provides and those the
 
623
package requires (see L<"Three-Part Linkage"> below).
 
624
 
 
625
=item RPMTAG_OS ($)
 
626
 
 
627
The name of the O/S for which the package is intended.
 
628
 
 
629
=item RPMTAG_PACKAGER ($)
 
630
 
 
631
Name of the group/company/individual who built the package.
 
632
 
 
633
=item RPMTAG_PATCH (@)
 
634
 
 
635
A list of patch files (see L<patch>) that will be applied to the source tree
 
636
when building the package from a source-RPM (SRPM). These files are part of
 
637
the bundle in the SRPM. All patch files listed in the original spec are listed
 
638
here, even if some were excluded by the B<NOPATCH> tag defined earlier.
 
639
 
 
640
=item RPMTAG_POSTIN (@)
 
641
 
 
642
Post-installation scripts, each entry in the list holds the text for a full
 
643
script.
 
644
 
 
645
=item RPMTAG_POSTINPROG (@)
 
646
 
 
647
The program (and additional arguments) for executing post-installation scripts.
 
648
The default is B</bin/sh> with no arguments. This is much like the C argv/argc
 
649
pair, in that list subscript 0 represents the program itself while the
 
650
remaining list items (if any) are arguments to the program.
 
651
 
 
652
=item RPMTAG_POSTUN (@)
 
653
 
 
654
Post-uninstallation scripts, again with one full script per array item.
 
655
 
 
656
=item RPMTAG_POSTUNPROG (@)
 
657
 
 
658
Specification of the program to run post-uninstallation scripts. See
 
659
B<RPMTAG_POSTINPROG>.
 
660
 
 
661
=item RPMTAG_PREFIXES (@)
 
662
 
 
663
The list of directory prefixes under which files are (or will be) installed.
 
664
This differs from the B<DIRNAMES> tag in that it is used to specify the parts
 
665
of the filesystem affected. Thus, it is generally a shorter list and the
 
666
elements are more basic (three directories under C</usr> in B<DIRNAMES> will
 
667
only warrant a mention of C</usr> in this tag).
 
668
 
 
669
=item RPMTAG_PREIN (@)
 
670
 
 
671
=item RPMTAG_PREINPROG (@)
 
672
 
 
673
=item RPMTAG_PREUN (@)
 
674
 
 
675
=item RPMTAG_PREUNPROG (@)
 
676
 
 
677
Specification of the scripts and commands to use in executing them, for
 
678
pre-installation and pre-uninstallation. See the B<RPMTAG_POST*> set above.
 
679
 
 
680
=item RPMTAG_PROVIDEFLAGS (@)
 
681
 
 
682
=item RPMTAG_PROVIDENAME (@)
 
683
 
 
684
=item RPMTAG_PROVIDEVERSION (@)
 
685
 
 
686
These three items are used in conjunction to specify the specific files that
 
687
the package itself provides to other packages as possible dependancies. Of the
 
688
three, only B<RPMTAG_PROVIDENAME> is required to have data in all elements
 
689
of the array.  The other two will have the same number of elements, though
 
690
some (or most) may be null. This three-part specification is also used to
 
691
itemize dependancies and obsoletions (see L<"Three-Part Linkage">).
 
692
 
 
693
=item RPMTAG_RELEASE ($)
 
694
 
 
695
The release part of the identifying triple for a package. This is combined
 
696
with the B<RPMTAG_NAME> and B<RPMTAG_VERSION> tags to create a unique
 
697
identification for each package.
 
698
 
 
699
=item RPMTAG_REQUIREFLAGS (@)
 
700
 
 
701
=item RPMTAG_REQUIRENAME (@)
 
702
 
 
703
=item RPMTAG_REQUIREVERSION (@)
 
704
 
 
705
These three items are used in conjunction to specify packages and/or
 
706
individual files on which the package itself depends. Of the three, only
 
707
B<RPMTAG_REQUIRENAME> is required to have data in all elements of the array.
 
708
The other two will have the same number of elements, though some (or most)
 
709
may be null. This is the same approach as is used to specify the elements
 
710
that the package provides and those the package obsoletes (see
 
711
L<"Three-Part Linkage">).
 
712
 
 
713
=item RPMTAG_RPMVERSION ($)
 
714
 
 
715
The version of B<rpm> used when bundling the package.
 
716
 
 
717
=item RPMTAG_SIZE ($)
 
718
 
 
719
Total size of the package contents, the sum of individual file sizes.
 
720
 
 
721
=item RPMTAG_SOURCE (@)
 
722
 
 
723
A list of the source files that are present in the SRPM package. All files
 
724
listed here will be placed in the relevant C<SOURCES> directory when building
 
725
from this SRPM. All source files listed in the original spec are listed here,
 
726
even if some were excluded by the B<NOSOURCE> tag defined earlier.
 
727
 
 
728
=item RPMTAG_SOURCERPM ($)
 
729
 
 
730
The source-RPM (SRPM) file used to build this package. If the file being
 
731
queried is itself a source-RPM, this tag will be non-existent or null in
 
732
value.
 
733
 
 
734
=item RPMTAG_SUMMARY ($)
 
735
 
 
736
A one line summary description of the package.
 
737
 
 
738
=item RPMTAG_TRIGGERCONDS (@)
 
739
 
 
740
=item RPMTAG_TRIGGERFLAGS (@)
 
741
 
 
742
=item RPMTAG_TRIGGERINDEX (@)
 
743
 
 
744
=item RPMTAG_TRIGGERNAME (@)
 
745
 
 
746
=item RPMTAG_TRIGGERSCRIPTPROG (@)
 
747
 
 
748
=item RPMTAG_TRIGGERSCRIPTS (@)
 
749
 
 
750
=item RPMTAG_TRIGGERVERSION (@)
 
751
 
 
752
These items are all taken together to manage the trigger functionality and
 
753
mechanism of the RPM package. This is covered in greater depth in a later
 
754
section (see L<"The Trigger Specifications">).
 
755
 
 
756
=item RPMTAG_URL ($)
 
757
 
 
758
A Uniform Resource Locator (generally a WWW page) for the vendor/individual
 
759
or for the software project itself.
 
760
 
 
761
=item RPMTAG_VENDOR ($)
 
762
 
 
763
An alternate identifier for the company that created and provided the package.
 
764
 
 
765
=item RPMTAG_VERIFYSCRIPT (@)
 
766
 
 
767
Scripts to be run during the verification stage. As with other script-providing
 
768
tags, each array element contains one full script.
 
769
 
 
770
=item RPMTAG_VERIFYSCRIPTPROG (@)
 
771
 
 
772
The program (and arguments) that is to be used in executing the verification
 
773
scripts. If absent or empty, C</bin/sh> with no arguments is used.
 
774
 
 
775
=item RPMTAG_VERSION ($)
 
776
 
 
777
The package version, the second part (with B<RPMTAG_NAME> and
 
778
B<RPMTAG_RELEASE>) of the triple used to uniquely identify packages.
 
779
 
 
780
=item RPMTAG_XPM ($)
 
781
 
 
782
The name of a file in the SRPM that may be used as an icon by a GUI-based
 
783
tool. This differs from B<RPMTAG_ICON> above in that it implies that the file
 
784
is specifically a XPM format image.
 
785
 
 
786
=back
 
787
 
 
788
=head2 Three-Part Linkage
 
789
 
 
790
There are several groupings of tags that are used to specify a linkage of
 
791
some sort, often external in nature. These triple-tags consist of a list of
 
792
textual names, a list of corresponding versions and a list of flag fields.
 
793
Of the three, only the list of names is required to have data in every
 
794
element. The other two lists will have the same number of elements, however.
 
795
The version values are only applied when the corresponding name refers to
 
796
another RPM package.
 
797
 
 
798
When a version is specified, the corresponding package may need to be
 
799
logically equal to, less than (older than) or greater (newer) than the
 
800
version as specified. This is signified in the corresponding flags field
 
801
for the triple. The flags documented later (see L<"Dependancy Sense Flags">)
 
802
can be used to determine the specific relationship.
 
803
 
 
804
=head2 The Trigger Specifications
 
805
 
 
806
The concept of trigger scripts was added into RPM from version 3.0 onwards.
 
807
It provides a powerful and flexible (if delicate and tricky) mechanism by
 
808
which packages may be sensitive to the installation, un-installation or
 
809
upgrade of other packages. In C<RPM::Header> terms, triggers are managed
 
810
through a combination of seven different header tags.
 
811
 
 
812
Firstly, the tags C<RPMTAG_TRIGGERSCRIPTS> and C<RPMTAG_TRIGGERSCRIPTPROG>
 
813
behave in the same fashion as similar tags for other script specifications.
 
814
All the triggers are stored on the B<TRIGGERSCRIPTS> tag, with each script
 
815
stored as one contiguous string. The B<TRIGGERSCRIPTPROG> array will specify
 
816
the program (and optional additional arguments) if the program is anything
 
817
other than C</bin/sh> (with no arguments).
 
818
 
 
819
The C<RPMTAG_TRIGGERNAME> and C<RPMTAG_TRIGGERVERSION> lists are used to
 
820
specify the packages that a given trigger is sensitive to. The name refers
 
821
to the package name (as RPM knows it to be), while the version (if specified)
 
822
further narrows the dependancy. The C<RPMTAG_TRIGGERCONDS> tag appears to be
 
823
present for future use, but the C<RPMTAG_TRIGGERFLAGS> is used as similarly-
 
824
named tags are for other script specifiers. In addition to the usual relative
 
825
comparison flags, these will also have some trigger-specific flags that
 
826
identify the trigger as being attached to an install, un-install or upgrade.
 
827
See L<"Dependancy Sense Flags">.
 
828
 
 
829
Lastly, the C<RPMTAG_TRIGGERINDEX> list is used to associate a given trigger
 
830
entry (in the B<TRIGGERNAME> list) with a particular script from the
 
831
B<TRIGGERSCRIPTS> list. This is to optimize storage, as the likelihood exists
 
832
that a given script may be re-used for more than one trigger.
 
833
 
 
834
The tags C<RPMTAG_TRIGGERNAME>, C<RPMTAG_TRIGGERVERSION>,
 
835
C<RPMTAG_TRIGGERFLAGS> and C<RPMTAG_TRIGGERINDEX> must all have the same
 
836
number of elements.
 
837
 
 
838
=head2 Dependancy Sense Flags
 
839
 
 
840
The following values may be imported via the tag B<:rpmsense>, and are
 
841
used with the flags values from various triple-tag combinations, to establish
 
842
the nature of the requirement relationship. In the paragraphs below, The C<*>
 
843
refers to any of B<REQUIRE>, B<OBSOLETE>, B<PROVIDE> or B<CONFLICT>. The
 
844
trigger-related flags have different uses than the rest of the B<:rpmsense>
 
845
set, though they may also make use of the flags for version comparison.
 
846
 
 
847
=over
 
848
 
 
849
=item RPMSENSE_SENSEMASK
 
850
 
 
851
This is a mask that, when applied to a value from B<RPMTAG_*FLAGS>,
 
852
masks out all bits except for the following three values:
 
853
 
 
854
=item RPMSENSE_EQUAL
 
855
 
 
856
=item RPMSENSE_GREATER
 
857
 
 
858
=item RPMSENSE_LESS
 
859
 
 
860
These values are used to check the corresponding entries from
 
861
B<RPMTAG_*NAME> and B<RPMTAG_*VERSION>, and specify whether
 
862
the existing file should be of a version equal to, greater than or less than
 
863
the version specified. More than one flag may be present.
 
864
 
 
865
=item RPMSENSE_PREREQ
 
866
 
 
867
The corresponding item from B<RPMTAG_*NAME> is a simple pre-requisite,
 
868
generally without specific version checking.
 
869
 
 
870
=item RPMSENSE_TRIGGER
 
871
 
 
872
A mask value that will isolate the trigger flags below from any other data
 
873
in the flag field.
 
874
 
 
875
=item RPMSENSE_TRIGGERIN
 
876
 
 
877
The corresponding trigger is an installation trigger.
 
878
 
 
879
=item RPMSENSE_TRIGGERUN
 
880
 
 
881
The corresponding trigger is an uninstallation trigger.
 
882
 
 
883
=item RPMSENSE_TRIGGERPOSTUN
 
884
 
 
885
The corresponding trigger is a post-uninstallation trigger.
 
886
 
 
887
=back
 
888
 
 
889
=head2 Header Data Types
 
890
 
 
891
The following symbols may be imported via the tag B<:rpmtype>, and represent
 
892
the different types of which the various header tags (described above) may
 
893
return data:
 
894
 
 
895
=over
 
896
 
 
897
=item RPM_NULL_TYPE
 
898
 
 
899
This is used internally by the C-level B<rpm> library.
 
900
 
 
901
=item RPM_CHAR_TYPE
 
902
 
 
903
This type represents single-character data.
 
904
 
 
905
=item RPM_INT8_TYPE
 
906
 
 
907
All items of this type are 8-bit integers.
 
908
 
 
909
=item RPM_INT16_TYPE
 
910
 
 
911
This type represents 16-bit integers.
 
912
 
 
913
=item RPM_INT32_TYPE
 
914
 
 
915
This type represents 32-bit integers.
 
916
 
 
917
=item RPM_BIN_TYPE
 
918
 
 
919
Data of this type represents a chunk of binary data without any further
 
920
decoding or translation. It is stored as a string in Perl terms, and the
 
921
C<length> keyword should return the size of the chunk.
 
922
 
 
923
=item RPM_STRING_TYPE
 
924
 
 
925
=item RPM_STRING_ARRAY_TYPE
 
926
 
 
927
=item RPM_I18NSTRING_TYPE
 
928
 
 
929
These data types represent strings of text. Each are stored and treated the
 
930
same internally by Perl.
 
931
 
 
932
=back
 
933
 
 
934
=head2 Error Codes
 
935
 
 
936
The following symbols may be imported via the tag B<:rpmerr>. They represent
 
937
the set of pre-defined error conditions that the B<rpm> system anticipates
 
938
as possibly occuring:
 
939
 
 
940
=over
 
941
 
 
942
=item RPMERR_BADARG
 
943
 
 
944
This is the most common error type used within the Perl RPM bindings. It is
 
945
used here to indicate bad or missing data in method calls.
 
946
 
 
947
=item RPMERR_BADDEV
 
948
 
 
949
Signaled when a file in the contents list is a bad or unknown device type.
 
950
 
 
951
=item RPMERR_BADFILENAME
 
952
 
 
953
This error signifies that RPM was unable to generate a filename, or that a
 
954
filename that RPM tried to use led to an error.
 
955
 
 
956
=item RPMERR_BADMAGIC
 
957
 
 
958
Signaled whenever an attempt to read the lead-in of the header (the "file magic"
 
959
information) fails. May be due either to bad data in that part, or an I/O
 
960
failure in reading the data itself.
 
961
 
 
962
=item RPMERR_BADRELOCATE
 
963
 
 
964
An error with the relocation specifications in the spec file.
 
965
 
 
966
=item RPMERR_BADSIGTYPE
 
967
 
 
968
Signals that an older, obsoleted style of signature was detected.
 
969
 
 
970
=item RPMERR_BADSPEC
 
971
 
 
972
General errors in the parsing or processing of the spec file.
 
973
 
 
974
=item RPMERR_CHOWN
 
975
 
 
976
An error occured in using the B<chown> system call.
 
977
 
 
978
=item RPMERR_CPIO
 
979
 
 
980
Errors that may occur when using B<cpio> to either package or unpack the source.
 
981
 
 
982
=item RPMERR_CREATE
 
983
 
 
984
This is signaled when RPM cannot create a directory or file.
 
985
 
 
986
=item RPMERR_DBCORRUPT
 
987
 
 
988
Signaled for consistency errors found in the database.
 
989
 
 
990
=item RPMERR_DBGETINDEX
 
991
 
 
992
This error represents a failure to read a requested header record from the
 
993
database.
 
994
 
 
995
=item RPMERR_DBOPEN
 
996
 
 
997
An error when opening some component of the database.
 
998
 
 
999
=item RPMERR_DBPUTINDEX
 
1000
 
 
1001
This error signals a failure to either store or remove a specified entry into
 
1002
(or from) the database.
 
1003
 
 
1004
=item RPMERR_EXEC
 
1005
 
 
1006
An error occured when executing a sub-command (such as B<pgp>).
 
1007
 
 
1008
=item RPMERR_FILECONFLICT
 
1009
 
 
1010
A file conflict (not otherwise caught or handled by B<rpm> itself) was detected.
 
1011
 
 
1012
=item RPMERR_FLOCK
 
1013
 
 
1014
A failure to obtain a lock on the database. When the RPM library opens the
 
1015
database it places an exclusive lock on it. As such, there cannot be two
 
1016
processes (or two B<RPM::Database> instances) accessing the database at one
 
1017
time.
 
1018
 
 
1019
=item RPMERR_FORK
 
1020
 
 
1021
An error occured when RPM tried to fork a child process.
 
1022
 
 
1023
=item RPMERR_GDBMOPEN
 
1024
 
 
1025
An error occured when trying to open a GDBM (GNU DBM) database.
 
1026
 
 
1027
=item RPMERR_GDBMREAD
 
1028
 
 
1029
An error occured when trying to read from a GDBM database.
 
1030
 
 
1031
=item RPMERR_GDBMWRITE
 
1032
 
 
1033
An error occured when trying to write to a GDBM database.
 
1034
 
 
1035
=item RPMERR_GZIP
 
1036
 
 
1037
An error occured with the B<gzip> program.
 
1038
 
 
1039
=item RPMERR_INTERNAL
 
1040
 
 
1041
This is used to signal internal errors from within the RPM library. Odds are,
 
1042
if your program sees this error, you should exit as cleanly and quickly as
 
1043
possible.
 
1044
 
 
1045
=item RPMERR_LDD
 
1046
 
 
1047
An error occurred with the B<ldd> program.
 
1048
 
 
1049
=item RPMERR_MKDIR
 
1050
 
 
1051
An error code was returned from the C<mkdir> system call.
 
1052
 
 
1053
=item RPMERR_MTAB
 
1054
 
 
1055
An error occured when trying to determine file system information from the
 
1056
system C<mtab> file.
 
1057
 
 
1058
=item RPMERR_NEWPACKAGE
 
1059
 
 
1060
An attempt was made to create a new package with a specification of an RPM
 
1061
version older (less) than 3.
 
1062
 
 
1063
=item RPMERR_NOCREATEDB
 
1064
 
 
1065
An attempt was made to create the database when one already exists.
 
1066
 
 
1067
=item RPMERR_NOGROUP
 
1068
 
 
1069
A group specified for file group-ownership was not found in the list of groups
 
1070
on the system. The group C<root> will be used instead.
 
1071
 
 
1072
=item RPMERR_NORELOCATE
 
1073
 
 
1074
An attempt was made to relocate a package that is not relocatable.
 
1075
 
 
1076
=item RPMERR_NOSPACE
 
1077
 
 
1078
An attempt to write a package file failed for lack of available disk space.
 
1079
 
 
1080
=item RPMERR_NOSPEC
 
1081
 
 
1082
Am unpack operation on a source RPM failed to produce a spec file.
 
1083
 
 
1084
=item RPMERR_NOTSRPM
 
1085
 
 
1086
An operation was requested that can only be performed on a source RPM, but the
 
1087
specified package was a binary (or C<noarch>) RPM.
 
1088
 
 
1089
=item RPMERR_NOUSER
 
1090
 
 
1091
A specified user (for file ownership) does not exist, and C<root> will be used
 
1092
in its place. See B<RPMERR_NOGROUP>.
 
1093
 
 
1094
=item RPMERR_OLDDB
 
1095
 
 
1096
An old-format database is present.
 
1097
 
 
1098
=item RPMERR_OLDDBCORRUPT
 
1099
 
 
1100
An old-format database being read (for conversion) was found to be corrupt.
 
1101
 
 
1102
=item RPMERR_OLDDBMISSING
 
1103
 
 
1104
A request to convert an old-format database found that there was no such
 
1105
database present.
 
1106
 
 
1107
=item RPMERR_OLDPACKAGE
 
1108
 
 
1109
An old-format package was detected.
 
1110
 
 
1111
=item RPMERR_PKGINSTALLED
 
1112
 
 
1113
A package requested for install is already installed on the system.
 
1114
 
 
1115
=item RPMERR_READERROR
 
1116
 
 
1117
An error occurred while reading data.
 
1118
 
 
1119
=item RPMERR_RENAME
 
1120
 
 
1121
An error occured while renaming a file.
 
1122
 
 
1123
=item RPMERR_RMDIR
 
1124
 
 
1125
An attempted removal of a directory failed.
 
1126
 
 
1127
=item RPMERR_RPMRC
 
1128
 
 
1129
A parsing or format error in an RC (options) file occurred.
 
1130
 
 
1131
=item RPMERR_SCRIPT
 
1132
 
 
1133
An error occurred while executing a script.
 
1134
 
 
1135
=item RPMERR_SIGGEN
 
1136
 
 
1137
Some type of error occurred when generating a signature on the package.
 
1138
 
 
1139
=item RPMERR_STAT
 
1140
 
 
1141
There was a failure of some sort on a C<stat> system call.
 
1142
 
 
1143
=item RPMERR_UNKNOWNARCH
 
1144
 
 
1145
A requested architecture is unknown to RPM.
 
1146
 
 
1147
=item RPMERR_UNKNOWNOS
 
1148
 
 
1149
A requested operating system is unknown to RPM.
 
1150
 
 
1151
=item RPMERR_UNLINK
 
1152
 
 
1153
An error occurred with the C<unlink> system call.
 
1154
 
 
1155
=item RPMERR_UNMATCHEDIF
 
1156
 
 
1157
An C<%else> or C<%endif> directive was seen in the spec file, for which there
 
1158
is no corresponding C<%if>.
 
1159
 
 
1160
=back
 
1161
 
 
1162
=head2 File-Verification Flags
 
1163
 
 
1164
The values in the B<RPMTAG_FILEVERIFYFLAGS> list defined in the header-tags
 
1165
section earlier represent various combinations of the following values. These
 
1166
tags may be imported via B<:rpmverify>.
 
1167
 
 
1168
=over
 
1169
 
 
1170
=item RPMVERIFY_ALL
 
1171
 
 
1172
A full mask that will isolate the valid flag-bits from the flag field.
 
1173
 
 
1174
=item RPMVERIFY_NONE
 
1175
 
 
1176
An empty mask that will not match any tested verification flags.
 
1177
 
 
1178
=item RPMVERIFY_FILESIZE
 
1179
 
 
1180
Test the file size against the value in the header.
 
1181
 
 
1182
=item RPMVERIFY_GROUP
 
1183
 
 
1184
Test the file group ID against the value it should have been set to.
 
1185
 
 
1186
=item RPMVERIFY_LINKTO
 
1187
 
 
1188
If the file was to be a symbolic link, check that it is set correctly.
 
1189
 
 
1190
=item RPMVERIFY_MD5
 
1191
 
 
1192
Check the MD5 checksum for the file.
 
1193
 
 
1194
=item RPMVERIFY_MODE
 
1195
 
 
1196
Verify the file mode against the value it was to be set to.
 
1197
 
 
1198
=item RPMVERIFY_MTIME
 
1199
 
 
1200
Check the file modification-time against that which it should have been set.
 
1201
 
 
1202
=item RPMVERIFY_RDEV
 
1203
 
 
1204
Check the device field of the inode, if relevant.
 
1205
 
 
1206
=item RPMVERIFY_USER
 
1207
 
 
1208
Check the user ID to which ownership was set.
 
1209
 
 
1210
=back
 
1211
 
 
1212
When the verification of a given file fails, the return value contains the
 
1213
relevant bits from the values above, corresponding to what test(s) failed.
 
1214
In addition, any of the following may be set to indicate a larger problem:
 
1215
 
 
1216
=over
 
1217
 
 
1218
=item RPMVERIFY_LSTATFAIL
 
1219
 
 
1220
The attempt to read the inode information via C<lstat()> was not successful.
 
1221
This will guarantee that other bits in the return value are set, as well.
 
1222
 
 
1223
=item RPMVERIFY_READFAIL
 
1224
 
 
1225
The attempt to read the file or its data (for the sake of MD5, etc.) failed.
 
1226
 
 
1227
=item RPMVERIFY_READLINKFAIL
 
1228
 
 
1229
An attempt to do a C<readlink()> on the file, expected to be a symbolic link,
 
1230
failed.
 
1231
 
 
1232
=back
 
1233
 
 
1234
=head2 File Specification Flags
 
1235
 
 
1236
The following tags may be imported via the B<:rpmfile> specifier. They are
 
1237
used to express various characteristics of files in the archive, based on the
 
1238
value from B<RPMTAG_FILEFLAGS> that corresponds to a given file.
 
1239
 
 
1240
=over
 
1241
 
 
1242
=item RPMFILE_CONFIG
 
1243
 
 
1244
Not documented yet.
 
1245
 
 
1246
=item RPMFILE_DOC
 
1247
 
 
1248
Not documented yet.
 
1249
 
 
1250
=item RPMFILE_DONOTUSE
 
1251
 
 
1252
Not documented yet.
 
1253
 
 
1254
=item RPMFILE_GHOST
 
1255
 
 
1256
Not documented yet.
 
1257
 
 
1258
=item RPMFILE_LICENSE
 
1259
 
 
1260
Not documented yet.
 
1261
 
 
1262
=item RPMFILE_MISSINGOK
 
1263
 
 
1264
Not documented yet.
 
1265
 
 
1266
=item RPMFILE_NOREPLACE
 
1267
 
 
1268
Not documented yet.
 
1269
 
 
1270
=item RPMFILE_README
 
1271
 
 
1272
Not documented yet.
 
1273
 
 
1274
=item RPMFILE_SPECFILE
 
1275
 
 
1276
Not documented yet.
 
1277
 
 
1278
=item RPMFILE_STATE_NETSHARED
 
1279
 
 
1280
Not documented yet.
 
1281
 
 
1282
=item RPMFILE_STATE_NORMAL
 
1283
 
 
1284
Not documented yet.
 
1285
 
 
1286
=item RPMFILE_STATE_NOTINSTALLED
 
1287
 
 
1288
Not documented yet.
 
1289
 
 
1290
=item RPMFILE_STATE_REPLACED
 
1291
 
 
1292
Not documented yet.
 
1293
 
 
1294
=back
 
1295
 
 
1296
=head2 Not Yet Defined
 
1297
 
 
1298
The following have not yet been categorized. They may, after further research
 
1299
and development, be found to be un-needed by this package.
 
1300
 
 
1301
=over
 
1302
 
 
1303
=item ADD_SIGNATURE
 
1304
 
 
1305
Not documented yet.
 
1306
 
 
1307
=item CHECKSIG_GPG
 
1308
 
 
1309
Not documented yet.
 
1310
 
 
1311
=item CHECKSIG_MD5
 
1312
 
 
1313
Not documented yet.
 
1314
 
 
1315
=item CHECKSIG_PGP
 
1316
 
 
1317
Not documented yet.
 
1318
 
 
1319
=item INSTALL_HASH
 
1320
 
 
1321
Not documented yet.
 
1322
 
 
1323
=item INSTALL_LABEL
 
1324
 
 
1325
Not documented yet.
 
1326
 
 
1327
=item INSTALL_NODEPS
 
1328
 
 
1329
Not documented yet.
 
1330
 
 
1331
=item INSTALL_NOORDER
 
1332
 
 
1333
Not documented yet.
 
1334
 
 
1335
=item INSTALL_PERCENT
 
1336
 
 
1337
Not documented yet.
 
1338
 
 
1339
=item INSTALL_UPGRADE
 
1340
 
 
1341
Not documented yet.
 
1342
 
 
1343
=item QUERY_FOR_CONFIG
 
1344
 
 
1345
Not documented yet.
 
1346
 
 
1347
=item QUERY_FOR_DOCS
 
1348
 
 
1349
Not documented yet.
 
1350
 
 
1351
=item QUERY_FOR_DUMPFILES
 
1352
 
 
1353
Not documented yet.
 
1354
 
 
1355
=item QUERY_FOR_LIST
 
1356
 
 
1357
Not documented yet.
 
1358
 
 
1359
=item QUERY_FOR_STATE
 
1360
 
 
1361
Not documented yet.
 
1362
 
 
1363
=item RPMPROB_FILTER_DISKSPACE
 
1364
 
 
1365
Not documented yet.
 
1366
 
 
1367
=item RPMPROB_FILTER_FORCERELOCATE
 
1368
 
 
1369
Not documented yet.
 
1370
 
 
1371
=item RPMPROB_FILTER_IGNOREARCH
 
1372
 
 
1373
Not documented yet.
 
1374
 
 
1375
=item RPMPROB_FILTER_IGNOREOS
 
1376
 
 
1377
Not documented yet.
 
1378
 
 
1379
=item RPMPROB_FILTER_OLDPACKAGE
 
1380
 
 
1381
Not documented yet.
 
1382
 
 
1383
=item RPMPROB_FILTER_REPLACENEWFILES
 
1384
 
 
1385
Not documented yet.
 
1386
 
 
1387
=item RPMPROB_FILTER_REPLACEOLDFILES
 
1388
 
 
1389
Not documented yet.
 
1390
 
 
1391
=item RPMPROB_FILTER_REPLACEPKG
 
1392
 
 
1393
Not documented yet.
 
1394
 
 
1395
=item RPMSIGTAG_GPG
 
1396
 
 
1397
Not documented yet.
 
1398
 
 
1399
=item RPMSIGTAG_LEMD5_1
 
1400
 
 
1401
Not documented yet.
 
1402
 
 
1403
=item RPMSIGTAG_LEMD5_2
 
1404
 
 
1405
Not documented yet.
 
1406
 
 
1407
=item RPMSIGTAG_MD5
 
1408
 
 
1409
Not documented yet.
 
1410
 
 
1411
=item RPMSIGTAG_PGP
 
1412
 
 
1413
Not documented yet.
 
1414
 
 
1415
=item RPMSIGTAG_PGP5
 
1416
 
 
1417
Not documented yet.
 
1418
 
 
1419
=item RPMSIGTAG_SIZE
 
1420
 
 
1421
Not documented yet.
 
1422
 
 
1423
=item RPMSIG_BAD
 
1424
 
 
1425
Not documented yet.
 
1426
 
 
1427
=item RPMSIG_NOKEY
 
1428
 
 
1429
Not documented yet.
 
1430
 
 
1431
=item RPMSIG_NOTTRUSTED
 
1432
 
 
1433
Not documented yet.
 
1434
 
 
1435
=item RPMSIG_OK
 
1436
 
 
1437
Not documented yet.
 
1438
 
 
1439
=item RPMSIG_UNKNOWN
 
1440
 
 
1441
Not documented yet.
 
1442
 
 
1443
=item RPMTRANS_FLAG_ALLFILES
 
1444
 
 
1445
Not documented yet.
 
1446
 
 
1447
=item RPMTRANS_FLAG_BUILD_PROBS
 
1448
 
 
1449
Not documented yet.
 
1450
 
 
1451
=item RPMTRANS_FLAG_JUSTDB
 
1452
 
 
1453
Not documented yet.
 
1454
 
 
1455
=item RPMTRANS_FLAG_KEEPOBSOLETE
 
1456
 
 
1457
Not documented yet.
 
1458
 
 
1459
=item RPMTRANS_FLAG_NODOCS
 
1460
 
 
1461
Not documented yet.
 
1462
 
 
1463
=item RPMTRANS_FLAG_NOSCRIPTS
 
1464
 
 
1465
Not documented yet.
 
1466
 
 
1467
=item RPMTRANS_FLAG_NOTRIGGERS
 
1468
 
 
1469
Not documented yet.
 
1470
 
 
1471
=item RPMTRANS_FLAG_TEST
 
1472
 
 
1473
Not documented yet.
 
1474
 
 
1475
=item UNINSTALL_ALLMATCHES
 
1476
 
 
1477
Not documented yet.
 
1478
 
 
1479
=item UNINSTALL_NODEPS
 
1480
 
 
1481
Not documented yet.
 
1482
 
 
1483
=item VERIFY_DEPS
 
1484
 
 
1485
Not documented yet.
 
1486
 
 
1487
=item VERIFY_FILES
 
1488
 
 
1489
Not documented yet.
 
1490
 
 
1491
=item VERIFY_MD5
 
1492
 
 
1493
Not documented yet.
 
1494
 
 
1495
=item VERIFY_SCRIPT
 
1496
 
 
1497
Not documented yet.
 
1498
 
 
1499
=back
 
1500
 
 
1501
=head1 SEE ALSO
 
1502
 
 
1503
L<RPM>, L<perl>, L<rpm>
 
1504
 
 
1505
=head1 AUTHOR
 
1506
 
 
1507
Randy J. Ray <rjray@blackperl.com>
 
1508
 
 
1509
=cut