class RPM::Package
- RPM::Package
- Reference
- Object
Overview
RPM Package Header data container
Defined in:
rpm/dependency.crrpm/package.cr
Class Method Summary
-
.create(name : String, version : Version)
Creates a new package header with given name and version
-
.open(filename)
Open existing RPM Package file
-
.open(filename, *, transaction : Transaction)
Open existing RPM package file, using existing transaction
Instance Method Summary
-
#[](tag)
Get the value of given
Tag
directly. -
#[]?(tag)
Get the value of given
Tag
directly. -
#changelogs
Get the list of Changelogs.
-
#conflicts
Get the list of "Conflict" dependencies.
-
#file_paths : Array(String)
Get the list of file paths.
-
#files : Array(RPM::File)
Get the list of files with extra metadata.
-
#finalize
Cleanup the handle to package header.
- #get_tagdata(tag : Tag | TagValue, *, flags : HeaderGetFlags = HeaderGetFlags::MINMEM)
- #get_tagdata(tag : DbiTag, **opts)
- #get_tagdata?(tag : Tag | TagValue, *, flags : HeaderGetFlags = HeaderGetFlags::MINMEM)
- #get_tagdata?(tag : DbiTag, **opts)
-
#instance
Returns header instance
-
#name
Returns the name of package.
-
#obsoletes
Get the list of "Obsolete" dependencies.
-
#provides
Get the list of "Provide" dependencies.
-
#requires
Get the list of "Require" dependencies.
-
#signature
Returns the signature string
-
#sprintf(fmt)
Format a string with package data
-
#to_unsafe : RPM::LibRPM::Header
Returns pointer to
header
to deal with librpm C API directly. - #with_tagdata(*tags, **opts, &)
- #with_tagdata?(*tags, **opts, &)
Class Method Detail
Creates a new package header with given name and version
Open existing RPM package file, using existing transaction
Instance Method Detail
Get the list of file paths.
Handy function for getting file paths. Since RPM stores basename and dirname separately, this method concatenate them to represents list of fullpaths.
Cleanup the handle to package header.
The package header does not seem to depend to the external resources (fd for the file or DB). So calling this method is not mandated.
Raises TypeCastError
if the given tag is not valid for Tag
.
Raises KeyError
if the given tag is not found.
Returns header instance
If this instance is from rpmdb, returns the rpmdb record number. Otherwise returns 0.
Returns the signature string
Returns the signature string with hexadecimal charactors.
Returns the string (none)
if not set.
If you want a binary data, you may use
#with_tagdata(Tag::SigMD5)
and TagData#bytes
. But it just
converts back to binary from this hexadecimal character representation.
Format a string with package data
The format is same to the --queryformat
argument in rpm -q
:
for example, %{name}
will be replaced with the name of the
package and %{version}
will be replaced with the version of
the package.
Get TagData
(s) for given Tag
(s), yield them and then cleanup them.
Returns the result of given block.
Raises KeyError
if one of tags
is not found. In this case,
the block will not be yielded.