1
###############################################################################
3
# (c) Copyright @ 2000, Randy J. Ray <rjray@blackperl.com>
6
###############################################################################
8
# $Id: Constants.pm,v 1.18 2001/04/27 09:05:21 rjray Exp $
10
# Description: Constants for the RPM package
12
# Functions: None-- constants are implemented as pseudo-functions
14
# Libraries: RPM (to force bootstrapping)
16
###############################################################################
18
package RPM::Constants;
21
use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS $VERSION $AUTOLOAD);
29
$VERSION = do { my @r=(q$Revision: 1.18 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r };
114
RPMFILE_STATE_NETSHARED
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
134
RPMSENSE_TRIGGERPOSTUN
162
RPMTAG_CONFLICTVERSION
186
RPMTAG_FILEVERIFYFLAGS
198
RPMTAG_OBSOLETEVERSION
213
RPMTAG_PROVIDEVERSION
217
RPMTAG_REQUIREVERSION
227
RPMTAG_TRIGGERSCRIPTPROG
228
RPMTAG_TRIGGERSCRIPTS
229
RPMTAG_TRIGGERVERSION
233
RPMTAG_VERIFYSCRIPTPROG
236
RPMTRANS_FLAG_ALLFILES
237
RPMTRANS_FLAG_BUILD_PROBS
239
RPMTRANS_FLAG_KEEPOBSOLETE
241
RPMTRANS_FLAG_NOSCRIPTS
242
RPMTRANS_FLAG_NOTRIGGERS
255
RPMVERIFY_READLINKFAIL
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"
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))
276
my $pat = qr/^$group/i;
279
for (grep($_ =~ $pat, sort keys %consts))
285
$groups{$group} = $list;
288
# Types didn't fit neatly into the above logic-loop
289
$groups{rpmtype} = [];
290
for (grep($_ =~ /^RPM_.*_TYPE/, sort keys %consts))
292
push(@{$groups{rpmtype}}, $_);
296
# Pick up any stragglers
297
$groups{misc} = [ sort keys %consts ];
299
# Merge the install and uninstall groups
300
push(@{$groups{install}}, @{$groups{uninstall}});
301
delete $groups{uninstall};
304
all => [ @EXPORT_OK ],
311
($constname = $AUTOLOAD) =~ s/.*:://;
312
die "& not defined" if $constname eq 'constant';
313
my $val = constant($constname);
316
die "Your vendor has not defined RPM macro $constname";
319
*$AUTOLOAD = sub { $val };
329
RPM::Constants - Groups of RPM-defined symbols
333
use RPM::Constants qw(:rpmerr :rpmtype);
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.
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:
345
=head2 Header Tag Identifiers
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>.
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.
365
=item RPMTAG_ARCH ($)
367
Name of the architecture that the package was built for. If the package
368
is architecture-independant, the value should read "noarch".
370
=item RPMTAG_ARCHIVESIZE ($)
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
377
=item RPMTAG_BASENAMES (@)
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>.
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.
387
=item RPMTAG_BUILDARCHS (@)
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
394
=item RPMTAG_BUILDHOST ($)
396
Name of the host the package was built on.
398
=item RPMTAG_BUILDMACROS (@)
400
This does not seem to be used in the library. It may be present for future
403
=item RPMTAG_BUILDROOT ($)
405
Specifies the root at which the package is built.
407
=item RPMTAG_BUILDTIME ($)
409
The time/date when the package was created, expressed as a C<time()> value
410
(seconds since the epoch).
412
=item RPMTAG_CHANGELOGNAME (@)
414
=item RPMTAG_CHANGELOGTEXT (@)
416
=item RPMTAG_CHANGELOGTIME (@)
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.
424
=item RPMTAG_CONFLICTFLAGS (@)
426
=item RPMTAG_CONFLICTNAME (@)
428
=item RPMTAG_CONFLICTVERSION (@)
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).
438
=item RPMTAG_COPYRIGHT
440
Maintained by RPM for backwards-compatibility with some older packages. It
441
is the same as C<RPMTAG_LICENSE>.
443
=item RPMTAG_COOKIE ($)
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.
449
=item RPMTAG_DESCRIPTION ($)
451
A textual description of the package.
453
=item RPMTAG_DIRINDEXES (@)
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
461
=item RPMTAG_DIRNAMES (@)
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.
467
=item RPMTAG_DISTRIBUTION ($)
469
A text label identifying the name given to the overall larger distribution
470
the package itself is a part of.
472
=item RPMTAG_EXCLUDEARCH (@)
474
A list of architectures for which the package should not be built.
476
=item RPMTAG_EXCLUDEOS (@)
478
A list of operating systems for which the package should not be built.
480
=item RPMTAG_EXCLUSIVEARCH (@)
482
A list of architectures only for which the package should be built.
484
=item RPMTAG_EXCLUSIVEOS (@)
486
A list of operating systems only for which the package should be built.
488
=item RPMTAG_FILEDEVICES (@)
490
The integer device values (from the B<stat> system call) for each file in
493
=item RPMTAG_FILEFLAGS (@)
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.
498
=item RPMTAG_FILEGROUPNAME (@)
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>.
505
=item RPMTAG_FILEINODES (@)
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.
510
=item RPMTAG_FILELANGS (@)
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.
515
=item RPMTAG_FILELINKTOS (@)
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.
521
=item RPMTAG_FILEMD5S (@)
523
MD5 checksums for each file in the package.
525
=item RPMTAG_FILEMODES (@)
527
The file-modes as integer values, for each file in the package.
529
=item RPMTAG_FILEMTIMES (@)
531
The integer modification-time (from the B<stat> system call) for each file in
534
=item RPMTAG_FILERDEVS (@)
536
The integer C<rdev> values (from the B<stat> system call) for each file in
539
=item RPMTAG_FILESIZES (@)
541
The size (in bytes) of each file in the package.
543
=item RPMTAG_FILESTATES (@)
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>.
548
=item RPMTAG_FILEUSERNAME (@)
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>.
555
=item RPMTAG_FILEVERIFYFLAGS (@)
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.
563
Similar to B<RPMTAG_ICON> defined below, with the restriction that the file
564
specified should in fact be a GIF image.
566
=item RPMTAG_GROUP ($)
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).
573
=item RPMTAG_ICON ($)
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.
579
=item RPMTAG_INSTALLTIME ($)
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.
584
=item RPMTAG_INSTPREFIXES (@)
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).
590
=item RPMTAG_LICENSE ($)
592
The license and/or restrictions under which the package is distributed.
594
=item RPMTAG_NAME ($)
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.
600
=item RPMTAG_NOPATCH (@)
602
=item RPMTAG_NOSOURCE (@)
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).
611
=item RPMTAG_OBSOLETEFLAGS (@)
613
=item RPMTAG_OBSOLETENAME (@)
615
=item RPMTAG_OBSOLETEVERSION (@)
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).
627
The name of the O/S for which the package is intended.
629
=item RPMTAG_PACKAGER ($)
631
Name of the group/company/individual who built the package.
633
=item RPMTAG_PATCH (@)
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.
640
=item RPMTAG_POSTIN (@)
642
Post-installation scripts, each entry in the list holds the text for a full
645
=item RPMTAG_POSTINPROG (@)
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.
652
=item RPMTAG_POSTUN (@)
654
Post-uninstallation scripts, again with one full script per array item.
656
=item RPMTAG_POSTUNPROG (@)
658
Specification of the program to run post-uninstallation scripts. See
659
B<RPMTAG_POSTINPROG>.
661
=item RPMTAG_PREFIXES (@)
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).
669
=item RPMTAG_PREIN (@)
671
=item RPMTAG_PREINPROG (@)
673
=item RPMTAG_PREUN (@)
675
=item RPMTAG_PREUNPROG (@)
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.
680
=item RPMTAG_PROVIDEFLAGS (@)
682
=item RPMTAG_PROVIDENAME (@)
684
=item RPMTAG_PROVIDEVERSION (@)
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">).
693
=item RPMTAG_RELEASE ($)
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.
699
=item RPMTAG_REQUIREFLAGS (@)
701
=item RPMTAG_REQUIRENAME (@)
703
=item RPMTAG_REQUIREVERSION (@)
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">).
713
=item RPMTAG_RPMVERSION ($)
715
The version of B<rpm> used when bundling the package.
717
=item RPMTAG_SIZE ($)
719
Total size of the package contents, the sum of individual file sizes.
721
=item RPMTAG_SOURCE (@)
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.
728
=item RPMTAG_SOURCERPM ($)
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
734
=item RPMTAG_SUMMARY ($)
736
A one line summary description of the package.
738
=item RPMTAG_TRIGGERCONDS (@)
740
=item RPMTAG_TRIGGERFLAGS (@)
742
=item RPMTAG_TRIGGERINDEX (@)
744
=item RPMTAG_TRIGGERNAME (@)
746
=item RPMTAG_TRIGGERSCRIPTPROG (@)
748
=item RPMTAG_TRIGGERSCRIPTS (@)
750
=item RPMTAG_TRIGGERVERSION (@)
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">).
758
A Uniform Resource Locator (generally a WWW page) for the vendor/individual
759
or for the software project itself.
761
=item RPMTAG_VENDOR ($)
763
An alternate identifier for the company that created and provided the package.
765
=item RPMTAG_VERIFYSCRIPT (@)
767
Scripts to be run during the verification stage. As with other script-providing
768
tags, each array element contains one full script.
770
=item RPMTAG_VERIFYSCRIPTPROG (@)
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.
775
=item RPMTAG_VERSION ($)
777
The package version, the second part (with B<RPMTAG_NAME> and
778
B<RPMTAG_RELEASE>) of the triple used to uniquely identify packages.
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.
788
=head2 Three-Part Linkage
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
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.
804
=head2 The Trigger Specifications
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.
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).
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">.
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.
834
The tags C<RPMTAG_TRIGGERNAME>, C<RPMTAG_TRIGGERVERSION>,
835
C<RPMTAG_TRIGGERFLAGS> and C<RPMTAG_TRIGGERINDEX> must all have the same
838
=head2 Dependancy Sense Flags
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.
849
=item RPMSENSE_SENSEMASK
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:
856
=item RPMSENSE_GREATER
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.
865
=item RPMSENSE_PREREQ
867
The corresponding item from B<RPMTAG_*NAME> is a simple pre-requisite,
868
generally without specific version checking.
870
=item RPMSENSE_TRIGGER
872
A mask value that will isolate the trigger flags below from any other data
875
=item RPMSENSE_TRIGGERIN
877
The corresponding trigger is an installation trigger.
879
=item RPMSENSE_TRIGGERUN
881
The corresponding trigger is an uninstallation trigger.
883
=item RPMSENSE_TRIGGERPOSTUN
885
The corresponding trigger is a post-uninstallation trigger.
889
=head2 Header Data Types
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
899
This is used internally by the C-level B<rpm> library.
903
This type represents single-character data.
907
All items of this type are 8-bit integers.
911
This type represents 16-bit integers.
915
This type represents 32-bit integers.
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.
923
=item RPM_STRING_TYPE
925
=item RPM_STRING_ARRAY_TYPE
927
=item RPM_I18NSTRING_TYPE
929
These data types represent strings of text. Each are stored and treated the
930
same internally by Perl.
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:
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.
949
Signaled when a file in the contents list is a bad or unknown device type.
951
=item RPMERR_BADFILENAME
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.
956
=item RPMERR_BADMAGIC
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.
962
=item RPMERR_BADRELOCATE
964
An error with the relocation specifications in the spec file.
966
=item RPMERR_BADSIGTYPE
968
Signals that an older, obsoleted style of signature was detected.
972
General errors in the parsing or processing of the spec file.
976
An error occured in using the B<chown> system call.
980
Errors that may occur when using B<cpio> to either package or unpack the source.
984
This is signaled when RPM cannot create a directory or file.
986
=item RPMERR_DBCORRUPT
988
Signaled for consistency errors found in the database.
990
=item RPMERR_DBGETINDEX
992
This error represents a failure to read a requested header record from the
997
An error when opening some component of the database.
999
=item RPMERR_DBPUTINDEX
1001
This error signals a failure to either store or remove a specified entry into
1002
(or from) the database.
1006
An error occured when executing a sub-command (such as B<pgp>).
1008
=item RPMERR_FILECONFLICT
1010
A file conflict (not otherwise caught or handled by B<rpm> itself) was detected.
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
1021
An error occured when RPM tried to fork a child process.
1023
=item RPMERR_GDBMOPEN
1025
An error occured when trying to open a GDBM (GNU DBM) database.
1027
=item RPMERR_GDBMREAD
1029
An error occured when trying to read from a GDBM database.
1031
=item RPMERR_GDBMWRITE
1033
An error occured when trying to write to a GDBM database.
1037
An error occured with the B<gzip> program.
1039
=item RPMERR_INTERNAL
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
1047
An error occurred with the B<ldd> program.
1051
An error code was returned from the C<mkdir> system call.
1055
An error occured when trying to determine file system information from the
1056
system C<mtab> file.
1058
=item RPMERR_NEWPACKAGE
1060
An attempt was made to create a new package with a specification of an RPM
1061
version older (less) than 3.
1063
=item RPMERR_NOCREATEDB
1065
An attempt was made to create the database when one already exists.
1067
=item RPMERR_NOGROUP
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.
1072
=item RPMERR_NORELOCATE
1074
An attempt was made to relocate a package that is not relocatable.
1076
=item RPMERR_NOSPACE
1078
An attempt to write a package file failed for lack of available disk space.
1082
Am unpack operation on a source RPM failed to produce a spec file.
1084
=item RPMERR_NOTSRPM
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.
1091
A specified user (for file ownership) does not exist, and C<root> will be used
1092
in its place. See B<RPMERR_NOGROUP>.
1096
An old-format database is present.
1098
=item RPMERR_OLDDBCORRUPT
1100
An old-format database being read (for conversion) was found to be corrupt.
1102
=item RPMERR_OLDDBMISSING
1104
A request to convert an old-format database found that there was no such
1107
=item RPMERR_OLDPACKAGE
1109
An old-format package was detected.
1111
=item RPMERR_PKGINSTALLED
1113
A package requested for install is already installed on the system.
1115
=item RPMERR_READERROR
1117
An error occurred while reading data.
1121
An error occured while renaming a file.
1125
An attempted removal of a directory failed.
1129
A parsing or format error in an RC (options) file occurred.
1133
An error occurred while executing a script.
1137
Some type of error occurred when generating a signature on the package.
1141
There was a failure of some sort on a C<stat> system call.
1143
=item RPMERR_UNKNOWNARCH
1145
A requested architecture is unknown to RPM.
1147
=item RPMERR_UNKNOWNOS
1149
A requested operating system is unknown to RPM.
1153
An error occurred with the C<unlink> system call.
1155
=item RPMERR_UNMATCHEDIF
1157
An C<%else> or C<%endif> directive was seen in the spec file, for which there
1158
is no corresponding C<%if>.
1162
=head2 File-Verification Flags
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>.
1172
A full mask that will isolate the valid flag-bits from the flag field.
1174
=item RPMVERIFY_NONE
1176
An empty mask that will not match any tested verification flags.
1178
=item RPMVERIFY_FILESIZE
1180
Test the file size against the value in the header.
1182
=item RPMVERIFY_GROUP
1184
Test the file group ID against the value it should have been set to.
1186
=item RPMVERIFY_LINKTO
1188
If the file was to be a symbolic link, check that it is set correctly.
1192
Check the MD5 checksum for the file.
1194
=item RPMVERIFY_MODE
1196
Verify the file mode against the value it was to be set to.
1198
=item RPMVERIFY_MTIME
1200
Check the file modification-time against that which it should have been set.
1202
=item RPMVERIFY_RDEV
1204
Check the device field of the inode, if relevant.
1206
=item RPMVERIFY_USER
1208
Check the user ID to which ownership was set.
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:
1218
=item RPMVERIFY_LSTATFAIL
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.
1223
=item RPMVERIFY_READFAIL
1225
The attempt to read the file or its data (for the sake of MD5, etc.) failed.
1227
=item RPMVERIFY_READLINKFAIL
1229
An attempt to do a C<readlink()> on the file, expected to be a symbolic link,
1234
=head2 File Specification Flags
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.
1242
=item RPMFILE_CONFIG
1250
=item RPMFILE_DONOTUSE
1258
=item RPMFILE_LICENSE
1262
=item RPMFILE_MISSINGOK
1266
=item RPMFILE_NOREPLACE
1270
=item RPMFILE_README
1274
=item RPMFILE_SPECFILE
1278
=item RPMFILE_STATE_NETSHARED
1282
=item RPMFILE_STATE_NORMAL
1286
=item RPMFILE_STATE_NOTINSTALLED
1290
=item RPMFILE_STATE_REPLACED
1296
=head2 Not Yet Defined
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.
1327
=item INSTALL_NODEPS
1331
=item INSTALL_NOORDER
1335
=item INSTALL_PERCENT
1339
=item INSTALL_UPGRADE
1343
=item QUERY_FOR_CONFIG
1347
=item QUERY_FOR_DOCS
1351
=item QUERY_FOR_DUMPFILES
1355
=item QUERY_FOR_LIST
1359
=item QUERY_FOR_STATE
1363
=item RPMPROB_FILTER_DISKSPACE
1367
=item RPMPROB_FILTER_FORCERELOCATE
1371
=item RPMPROB_FILTER_IGNOREARCH
1375
=item RPMPROB_FILTER_IGNOREOS
1379
=item RPMPROB_FILTER_OLDPACKAGE
1383
=item RPMPROB_FILTER_REPLACENEWFILES
1387
=item RPMPROB_FILTER_REPLACEOLDFILES
1391
=item RPMPROB_FILTER_REPLACEPKG
1399
=item RPMSIGTAG_LEMD5_1
1403
=item RPMSIGTAG_LEMD5_2
1415
=item RPMSIGTAG_PGP5
1419
=item RPMSIGTAG_SIZE
1431
=item RPMSIG_NOTTRUSTED
1439
=item RPMSIG_UNKNOWN
1443
=item RPMTRANS_FLAG_ALLFILES
1447
=item RPMTRANS_FLAG_BUILD_PROBS
1451
=item RPMTRANS_FLAG_JUSTDB
1455
=item RPMTRANS_FLAG_KEEPOBSOLETE
1459
=item RPMTRANS_FLAG_NODOCS
1463
=item RPMTRANS_FLAG_NOSCRIPTS
1467
=item RPMTRANS_FLAG_NOTRIGGERS
1471
=item RPMTRANS_FLAG_TEST
1475
=item UNINSTALL_ALLMATCHES
1479
=item UNINSTALL_NODEPS
1503
L<RPM>, L<perl>, L<rpm>
1507
Randy J. Ray <rjray@blackperl.com>