NAME
RPM4::Header
DESCRIPTION
The header contains informations about a rpms, this object give methods to manipulate its.
METHODS
RPM4::Header->new($item)
Create a new RPM4::Header
instance from:
- a file
-
if $item is an rpm file, returns the corresponding object.
- a file handler
-
if $item is a file handler, returns an object corresponding to the next header there.
- nothing
-
if $item is omitted, returns an empty object.
If data are unreadable for whatever reason, returns undef.
RPM4::Header->write(*FILE)
Dump header data into file handle.
Warning: Perl modifier (like PerlIO::Gzip) won't works.
RPM4::Header->hsize()
Returns the on-disk size of header data, in bytes.
RPM4::Header->copy()
Returns a RPM4::Header object copy.
RPM4::Header->removetag(tagid)
Remove tag 'tagid' from header.
RPM4::Header->addtag(tagid, tagtype, value1, value2...)
Add a tag into the header: - tagid is the integervalue of tag - tagtype is an integer, it identify the tag type to add (see rpmlib headers files). Other argument are value to put in tag.
RPM4::Header->listtag()
Returns a list of tag id present in header.
RPM4::Header->hastag(tagid)
Returns true if tag 'tagid' is present in header.
Ex: $header->hastag(1000); # Returns true if tag 'NAME' is present.
RPM4::Header->tagtype(tagid)
Returns the tagtype value of tagid. Returns 0 if tagid is not found.
RPM4::Header->tag(tagid)
Returns array of tag value for tag 'tagid'.
$header->tag(1000); # return the name of rpm header.
RPM4::Header->queryformat($query)
Make a formated query on the header, macros in $query are evaluated. This function works like rpm --queryformat ...
$header->queryformat("%{NAME}-%{VERSION}-%{RELEASE}");
RPM4::Header->fullname
In scalar context return the "name-version-version.arch" of package. In array context return (name, version, release, arch) of package.
RPM4::Header->issrc()
Returns true if package is a source package.
RPM4::Header->compare(header)
Compare the header to another, return 1 if the object is higher, -1 if header passed as argument is better, 0 if update is not possible.