libpkgmanifest.manifest
- class libpkgmanifest.manifest.Checksum(*args)
Stores information about the package checksum.
- get_digest()
Retrieves the output of the checksum hash function.
- Return type:
string
- Returns:
The checksum digest.
- get_method()
Retrieves the method used for calculating the checksum.
- Return type:
int
- Returns:
The checksum calculation method.
- set_digest(digest)
Sets the output of the checksum hash function.
- Parameters:
digest (string) – The checksum digest to be set.
- set_method(method)
Sets the method used for calculating the checksum.
- Parameters:
method (int) – The checksum calculation method to be used.
- thisown
- libpkgmanifest.manifest.ChecksumMethod_CRC32
- libpkgmanifest.manifest.ChecksumMethod_CRC64
- libpkgmanifest.manifest.ChecksumMethod_MD5
- libpkgmanifest.manifest.ChecksumMethod_SHA1
- libpkgmanifest.manifest.ChecksumMethod_SHA224
- libpkgmanifest.manifest.ChecksumMethod_SHA256
- libpkgmanifest.manifest.ChecksumMethod_SHA384
- libpkgmanifest.manifest.ChecksumMethod_SHA512
- class libpkgmanifest.manifest.Manifest(*args)
The primary data class that stores all information related to the items in the manifest file.
- get_document()
Retrieves the YAML document identifier.
Notes: This is expected to be the value “rpm-package-manifest”.
- Return type:
string
- Returns:
The document identifier.
- get_packages()
Retrieves a structure containing all the packages defined in the manifest file.
- Return type:
- Returns:
A structure with the packages listed in the manifest.
- get_repositories()
Retrieves a structure containing all the repositories defined in the manifest file.
- Return type:
- Returns:
A structure with the repositories listed in the manifest.
- get_version()
Retrieves the version of the YAML document.
Notes: This version changes if the structure or format of the document’s properties has been updated.
- Return type:
- Returns:
The document version.
- set_document(document)
Sets the YAML document identifier.
- Parameters:
document (string) – The YAML identifier to set.
- set_packages(packages)
Assigns a structure with all the packages to be included in the manifest file.
- Parameters:
packages (
Packages) – A structure containing the packages to be set.
- set_repositories(repositories)
Assigns a structure with all the repositories to be included in the manifest file.
- Parameters:
repositories (
Repositories) – A structure containing the repositories to be set.
- set_version(version)
Sets the version of the YAML document.
- Parameters:
version (
Version) – The version to set for the document.
- thisown
- class libpkgmanifest.manifest.MapPackages(*args)
- asdict()
- begin()
- clear()
- count(x)
- empty()
- end()
- erase(*args)
- find(x)
- get_allocator()
- has_key(key)
- items()
- iterator()
- iteritems()
- iterkeys()
- itervalues()
- key_iterator()
- keys()
- lower_bound(x)
- rbegin()
- rend()
- size()
- swap(v)
- thisown
- upper_bound(x)
- value_iterator()
- values()
- class libpkgmanifest.manifest.MapRepositories(*args)
- asdict()
- begin()
- clear()
- count(x)
- empty()
- end()
- erase(*args)
- find(x)
- get_allocator()
- has_key(key)
- items()
- iterator()
- iteritems()
- iterkeys()
- itervalues()
- key_iterator()
- keys()
- lower_bound(x)
- rbegin()
- rend()
- size()
- swap(v)
- thisown
- upper_bound(x)
- value_iterator()
- values()
- class libpkgmanifest.manifest.Module(*args)
A structure that holds modularity-related information about the package.
Notes: For more details, refer to the official Modularity project documentation: https://docs.fedoraproject.org/en-US/modularity/.
- get_name()
Retrieves the Name of the module to which the package belongs.
- Return type:
string
- Returns:
A string representing the module name.
- get_stream()
Retrieves the stream identifier, which indicates the specific version or variant of the module.
- Return type:
string
- Returns:
A string representing the stream identifier.
- set_name(name)
Sets the name of the module to which the package belongs.
- Parameters:
name (string) – A string containing the module name.
- set_stream(stream)
Sets the stream identifier, which typically represents the version or variant of the module.
- Parameters:
stream (string) – A string containing the stream identifier.
- thisown
- class libpkgmanifest.manifest.Nevra(*args)
Format for the package identifier, including Name, (optional) Epoch, Version, Release, and Architecture fields.
Notes: For more details, refer to the official RPM documentation: https://rpm-software-management.github.io/rpm/manual/tags.html.
- get_arch()
Retrieves the package architecture.
- Return type:
string
- Returns:
The package architecture.
- get_epoch()
Retrieves the package epoch.
Notes: Can be empty if the epoch is not defined.
- Return type:
string
- Returns:
The package epoch.
- get_name()
Retrieves the package name.
- Return type:
string
- Returns:
The package name.
- get_release()
Retrieves the package release.
- Return type:
string
- Returns:
The package release.
- get_version()
Retrieves the package version.
- Return type:
string
- Returns:
The package version.
- set_arch(arch)
Sets the package architecture.
- Parameters:
arch (string) – The package architecture.
- set_epoch(epoch)
Sets the package epoch.
- Parameters:
epoch (string) – The package epoch.
- set_name(name)
Sets the package name.
- Parameters:
name (string) – The package name.
- set_release(release)
Sets the package release.
- Parameters:
release (string) – The package release.
- set_version(version)
Sets package version.
- Parameters:
version (string) – The package version.
- thisown
- to_string()
Converts the NEVRA object to its full string representation.
- Return type:
string
- Returns:
The NEVRA string.
- class libpkgmanifest.manifest.NoSuchRepositoryIdError(message)
Exception thrown when a repository with a given ID does not exist.
- thisown
- class libpkgmanifest.manifest.Package(*args)
Represents a single package within the manifest.
- attach(repositories)
Binds the repositories to the package object.
Notes: Used to reference and validate repository-related information within the package.
- Parameters:
repositories (
Repositories) – The repositories object to bind.
- get_checksum()
Retrieves the checksum associated with this package.
- Return type:
- Returns:
The package checksum.
- get_location()
Retrieves the package’s relative path within the repository.
- Return type:
string
- Returns:
The package’s relative path.
- get_module()
Retrieves the module information associated with this package.
- Return type:
- Returns:
The package module.
- get_nevra()
Retrieves the NEVRA package identifier.
- Return type:
- Returns:
The NEVRA identifier of the package.
- get_repo_id()
Retrieves the repository identifier the packages is from.
- Return type:
string
- Returns:
The repository ID.
- get_repository()
Retrieves the repository where the package originates.
- Return type:
- Returns:
The repository object.
- get_size()
Retrieves the download size of the package in bytes.
- Return type:
int
- Returns:
The size of the package in bytes.
- get_srpm()
Retrieves the NEVRA identifier of the source package.
Notes: This identifies the source package used to build this binary package.
- Return type:
- Returns:
The NEVRA identifier of the source package.
- get_url()
Retrieves the complete URL for downloading the package.
Notes: Constructed by combining the repository URL and the package’s relative location path.
- Return type:
string
- Returns:
The full URL of the package.
- set_checksum(checksum)
Sets the checksum associated with this package.
- Parameters:
checksum (
Checksum) – The checksum to be set for the package.
- set_location(location)
Sets the package’s relative path within the repository.
- Parameters:
location (string) – The path to be set for the package.
- set_module(module)
Sets the module information associated with this package.
- Parameters:
module (
Module) – The module to be set for the package.
- set_nevra(nevra)
Sets the package NEVRA identifier.
- Parameters:
nevra (
Nevra) – The NEVRA identifier to be set for the package.
- set_repo_id(repo_id)
Sets the repository identifier the package is from.
- Parameters:
repo_id (string) – The repository ID to be set.
- set_size(size)
Sets the download size of the package in bytes.
- Parameters:
size (int) – The size of the package in bytes to be set.
- set_srpm(srpm)
Sets the source package NEVRA identifier.
Notes: This identifies the source package used to build this binary package.
- Parameters:
srpm (
Nevra) – The source RPM NEVRA to be set for the package.
- thisown
- class libpkgmanifest.manifest.Packages(*args)
A container for all packages listed in the manifest.
- add(*args)
Overload 1: Adds a given package to the container.
Notes: The package is categorized within the container based on its architecture.
- Parameters:
package (
Package) – The package to be added.
Overload 2: Adds a given package to the container and link it to the given base architecture.
Notes: Used when storing multiple base architectures in a manifest file.
- Parameters:
package (
Package) – The package to be added.basearch (string) – The base architecture to link the package to.
- attach(repositories)
Binds the repositories to the packages object.
Notes: Used to reference and validate repository-related information within the packages.
- Parameters:
repositories (
Repositories) – The repositories object to bind.
- contains(package)
Verifies if the given package exists in the container.
Notes: Packages are considered identical if they share the same NEVRA and repository ID.
- Return type:
boolean
- Returns:
True if the package is present in the container.
- get(*args)
Overload 1: Retrieves a list of all packages in the container.
- Return type:
std::vector< libpkgmanifest::manifest::Package,std::allocator< libpkgmanifest::manifest::Package > >
- Returns:
A vector containing all packages.
Overload 2: Retrieves a list of packages filtered by the specified base architecture.
- Parameters:
basearch (string) – The base architecture used to filter the packages.
with_source (boolean, optional) – True if source packages should be included in the result.
- Return type:
std::vector< libpkgmanifest::manifest::Package,std::allocator< libpkgmanifest::manifest::Package > >
- Returns:
A vector containing the packages for the specified base architecture.
Overload 3: Retrieves a list of packages filtered by the specified base architecture.
- Parameters:
basearch (string) – The base architecture used to filter the packages.
with_source – True if source packages should be included in the result.
- Return type:
std::vector< libpkgmanifest::manifest::Package,std::allocator< libpkgmanifest::manifest::Package > >
- Returns:
A vector containing the packages for the specified base architecture.
- thisown
- values()
- class libpkgmanifest.manifest.Parser
A class responsible for parsing the YAML files into objects.
- parse(path)
Parses the manifest file from a specified file path.
- Parameters:
path (string) – The location of the manifest file.
- Return type:
- Returns:
A manifest object containing data parsed from the file.
- Raises:
ParserError if an error occurs during file parsing.
- thisown
- class libpkgmanifest.manifest.Repositories(*args)
A container for all repositories listed in the manifest.
- add(repository)
Adds a repository to the container.
- Parameters:
repository (
Repository) – The repository to add.
- begin()
Returns an iterator to the beginning of the container.
- contains(id)
Checks if a given repository exists.
- Parameters:
id (string) – The repository ID.
- Return type:
boolean
- Returns:
True if the given repository exists; otherwise, false.
- end()
Returns an iterator to the end of the container.
- get(id)
Retrieves a repository by its ID.
- Parameters:
id (string) – The repository ID.
- Return type:
- Returns:
A repository with the given ID.
- size()
Gets the number of repositories in the container.
- Return type:
std::size_t
- Returns:
The size of the repositories container.
- thisown
- libpkgmanifest.manifest.Repositories__iter__(self)
- class libpkgmanifest.manifest.Repository(*args)
Represents a single repository within the manifest.
- get_baseurl()
Retrieves the base URL of the repository.
- Return type:
string
- Returns:
The base URL.
- get_id()
Retrieves the repository ID.
- Return type:
string
- Returns:
The repository ID.
- get_metalink()
Retrieves the metalink URL of the repository.
- Return type:
string
- Returns:
The metalink URL.
- get_mirrorlist()
Retrieves the mirrorlist URL of the repository.
- Return type:
string
- Returns:
The mirrorlist URL.
- set_baseurl(baseurl)
Sets the base URL of the repository.
- Parameters:
baseurl (string) – The base URL to set.
- set_id(id)
Sets the repository ID.
- Parameters:
id (string) – The repository ID to set.
- set_metalink(metalink)
Sets the metalink URL of the repository.
- Parameters:
metalink (string) – The metalink URL to set.
- set_mirrorlist(mirrorlist)
Sets the mirrorlist URL of the repository.
- Parameters:
mirrorlist (string) – The mirrorlist URL to set.
- thisown
- class libpkgmanifest.manifest.Serializer
A class responsible for serializing the manifest object into a YAML file.
- serialize(manifest, path)
Serializes a manifest object to a specified file path.
- Parameters:
manifest (
Manifest) – The manifest object containing package data.path (string) – The file path where the manifest should be saved.
- Raises:
SerializerError if an error occurs during serialization.
- thisown
- class libpkgmanifest.manifest.SwigPyIterator(*args, **kwargs)
- advance(n)
- copy()
- decr(n=1)
- distance(x)
- equal(x)
- incr(n=1)
- next()
- previous()
- thisown
- value()
- class libpkgmanifest.manifest.VectorPackage(*args)
- append(x)
- assign(n, x)
- back()
- begin()
- capacity()
- clear()
- empty()
- end()
- erase(*args)
- front()
- get_allocator()
- insert(*args)
- iterator()
- pop()
- pop_back()
- push_back(x)
- rbegin()
- rend()
- reserve(n)
- size()
- swap(v)
- thisown
- class libpkgmanifest.manifest.VectorString(*args)
- append(x)
- assign(n, x)
- back()
- begin()
- capacity()
- clear()
- empty()
- end()
- erase(*args)
- front()
- get_allocator()
- insert(*args)
- iterator()
- pop()
- pop_back()
- push_back(x)
- rbegin()
- rend()
- reserve(n)
- resize(*args)
- size()
- swap(v)
- thisown
- libpkgmanifest.manifest.VectorString__add__(self, value)
- libpkgmanifest.manifest.VectorString__append(self, item)
- libpkgmanifest.manifest.VectorString__copy(self)
- libpkgmanifest.manifest.VectorString__count(self, item)
- libpkgmanifest.manifest.VectorString__eq__(self, other)
- libpkgmanifest.manifest.VectorString__extend(self, iterable)
- libpkgmanifest.manifest.VectorString__ge__(self, other)
- libpkgmanifest.manifest.VectorString__gt__(self, other)
- libpkgmanifest.manifest.VectorString__iadd__(self, value)
- libpkgmanifest.manifest.VectorString__imul__(self, value)
- libpkgmanifest.manifest.VectorString__index(self, *args, **kwargs)
- libpkgmanifest.manifest.VectorString__insert(self, *args, **kwargs)
- libpkgmanifest.manifest.VectorString__le__(self, other)
- libpkgmanifest.manifest.VectorString__lt__(self, other)
- libpkgmanifest.manifest.VectorString__mul__(self, value)
- libpkgmanifest.manifest.VectorString__ne__(self, other)
- libpkgmanifest.manifest.VectorString__remove(self, *args, **kwargs)
- libpkgmanifest.manifest.VectorString__reverse(self, *args, **kwargs)
- libpkgmanifest.manifest.VectorString__rmul__(self, value)
- libpkgmanifest.manifest.VectorString__sort(self, *args, **kwargs)
- libpkgmanifest.manifest.VectorString__str__(self)
- class libpkgmanifest.manifest.Version(*args)
Structure representing a version, supporting up to three components.
- get_major()
Retrieves the major version component.
- Return type:
int
- Returns:
The major version number.
- get_minor()
Retrieves the minor version component.
- Return type:
int
- Returns:
The minor version number.
- get_patch()
Retrieves the patch version component.
- Return type:
int
- Returns:
The patch version number.
- set_major(major)
Sets the major version component.
- Parameters:
major (int) – The value of the major version component.
- set_minor(minor)
Sets the minor version component.
- Parameters:
minor (int) – The value for the minor version component.
- set_patch(patch)
Sets the patch version component.
- Parameters:
patch (int) – The value for the patch version component.
- thisown
- libpkgmanifest.manifest.add_property_accessors(target_cls, src_cls=None, src_getter=None)
Dynamically creates attributes in the target class based on the getter and setter methods of a source class.
This method inspects the source class for methods with ‘get_’ and ‘set_’ prefixes, and creates corresponding properties in the target class. If a src_getter is provided, it is used to obtain an instance of the source class, allowing for delegation of property access.
- Args:
target_cls (type): The class where the properties will be added. src_cls (type, optional): The class to inspect for getter and setter methods.
If not provided, the target class is used.
- src_getter (callable, optional): A callable that takes an instance of the target class
and returns an instance of the source class. This is used for delegating property access.
- Example:
1. Simplifying Access in the Package Class - Before: package.get_size() - After calling add_property_accessors(Package): package.size
2. Delegating Access of Internal Objects - Before: package.get_nevra().get_name() - After calling add_property_accessors(Package, Nevra, Package.get_nevra): package.name