NAME

RPM - Perl interface to the API for the RPM Package Manager

DESCRIPTION

The Perl-RPM package is an extension for natively linking the functionality of the RPM Package Manager with the extension facility of Perl. The aim is to offer all the functionality made available via the C API in the form of Perl object classes.

At present, the package-manipulation functionality is not yet implemented. The RPM::Database and RPM::Header packages do provide access to the information contained within the database of installed packages, and individual package headers, respectively. The RPM::Error package is available, which provides support routines for signaling and catching errors. Additionally, there is the RPM::Constants package which provides a number of values from the rpm library, referred to by the same name used at the C level.

UTILITY FUNCTIONS

The following utility functions are exported by default from RPM:

rpm_osname

Returns the text name of the O/S, as derived from the rpm configuration files. This is the O/S token that rpm will use to refer to the running system.

rpm_archname

As above, but returns the architecture string instead. Again, this may not directly match the running system, but rather is the value that rpm is using. rpm will use the lowest-matching architecture whenever possible, for maximum cross-platform compatibility.

rpm_version

Returns the current version of RPM that the library is linked against. The value is a string of the form X.Y.Z.

The following utility function may be explicitly requested via use or import:

vercmp($verA, $relA, $verB, $relB)

Allows RPM-style comparison of version/release pairs without having the full RPM::Header objects in memory. This enables programs to compare versions without having to worry about how RPM handles the mixture of alphanumeric cases that are supported internally. The return value is -1, 0 or 1, as with any comparison operator. This is purposefully named differently from the cmpver method in RPM::Header so as to avoid confusion.

evrcmp($A, $B)

Similar to vercmp, but takes into account the Epoch along with Version/Release. Each of $A, $B must be either RPM::Header object or [Epoch:]Version[-Release] specification string.

DIAGNOSTICS

When an error occurs in either the C-level rpm library or internally within these libraries, it is made available via a special dual-nature variable $RPM::err. When evaluated in a numeric context, it returns the integer code value of the error. When taken in a string context, it returns the text message associated with the error. This is intended to closely mimic the behavior of the special Perl variable "$!".

CAVEATS

This is currently regarded as alpha-quality software. The interface is subject to change in future releases.

SEE ALSO

RPM::Constants, RPM::Database, RPM::Error, RPM::Header, perl, rpm

AUTHORS

Randy J. Ray <rjray@blackperl.com>, Alexey Tourbin <at@altlinux.org>.