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.
write(*FILE)
Dump header data into file handle.
Warning: Perl modifier (like PerlIO::Gzip) won't works.
hsize()
Returns the on-disk size of header data, in bytes.
copy()
Returns a RPM4::Header object copy.
removetag(tagid)
Remove tag 'tagid' from 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.
listtag()
Returns a list of tag id present in header.
hastag(tagid)
Returns true if tag 'tagid' is present in header.
Ex: $header->hastag(1000); # Returns true if tag 'NAME' is present.
tagtype(tagid)
Returns the tagtype value of tagid. Returns 0 if tagid is not found.
tag(tagid)
Returns array of tag value for tag 'tagid'.
$header->tag(1000); # return the name of rpm 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}");
fullname
In scalar context return the "name-version-version.arch" of package. In array context return (name, version, release, arch) of package.
issrc()
Returns true if package is a source package.
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.
dep($deptype)
Return a RPM4::Header::Dependencies object containing dependencies of type $deptype found in the header.
files()
Return a RPM4::Header::Files object containing the set of files include in the rpm.