RPM::Header(3)

NAME
RPM::Header

DESCRIPTION
A module to perform action on rpm b<header>.

The header is a set of data containing information about a rpm archive.

SINOPSYS
    use RPM::Header;

    my $header = rpm2header('any-1-1.noarch.rpm');
    print $header->header_sprintf('%{NAME}\n');
    # output "any" + carriage return

FUNCTIONS

  rpm2header(rpmfile, vsflags)
Read a rpm archive and return a RPM::Header object on success, return undef on error.

vsflags (optional) is either an integer value, either an arrayref containing textual values. See RPM::Constant.

  stream2header(filehandle)
Read all header store into a file from an open file handle.

Two usage:

stream2header(filehandle)
    stream2header return an array b<RPM::Header> object.

stream2header(filehandle, $callback)
    The function nothing, for each header read, $callback function is called with 'RPM::Header' passed as argument.

RPM::Header FUNCTIONS
In addition to the following methods, all tags have simple accessors; $hdr->epoch() is equivalent to $hdr->tag('epoch').

The <=> and cmp operators can be used to compare versions of two packages.

  $hdr->listtag
Return an array listing all tag set into the header.

  $hdr->hastag($tag)
Return True is $tag is set into the header.

$tag can be either the tagname, either the internal numeric value.

  $hdr->tagformat($format)
Return a format string from header like rpm --qf.

  $hdr->tag($tag)
Return tag content from the header, undef if tag is not set.

$tag can be either the tagname, either the internal numeric value.

  $hdr->tagtype($tag)
Return the tag type from the header, undef if tag is not set.

$tag can be either the tagname, either the internal numeric value.

  $hdr->removetag($tag)
Remove the tag from header.

  $hdr->addtag($tag, $tagtype, @value)
Add a tag to the header.

  $hdr->compare($header)
Compare two header.

  $hdr->is_source_package()
Returns a true value if the package is a source package, false otherwise.

  $hdr->copy
Return a RPM::Header copy of the header.

  $hdr->hsize
Return the size in byte of the header in it on disk rpresentation.

  $hdr->string
Return a in memory string representation of $hdr

  $hdr->write($handle)
Dump header into open file handle $handle.

  $hdr->changelog
Returns a list of hash refs containing the change log data of the package. The hash keys represent individual change log entries, and their keys are: "time" (the time of the changelog entry), "name" (the "name", ie. often the email address of the author of the entry), and "text" (the text of the entry).

  $hdr->as_nvre
Returns a string formatted like:

   epoch:name-version-release

If epoch is undefined for this package, it and the leading colon are omitted.

  $hdr->dependencies($tag)
Create a new RPM::Dependencies object from RPM::Header $hdr.

$tag is either PROVIDENAME, REQUIRENAME, CONFLICTNAME, OBSOLETENAME or TRIGGERNAME.

  $hdr->files()
Return a RPM::Files object from RPM::Header $hdr.

AUTHOR
Olivier Thauvin <nanardon@nanardon.zarb.org>