RPM helper module

class rebasehelper.helpers.rpm_helper.RpmHeader(hdr: <sphinx.ext.autodoc.importer._MockObject object at 0x7f9ce6d8bb90>)[source]
class rebasehelper.helpers.rpm_helper.RpmHelper[source]

Class for working with RPM database and packages.

ARCHES = []
static all_packages_installed(pkg_names=None)[source]

Checks if all specified packages are installed.

Parameters:pkg_names (list) – List of package names to check.
Returns:True if all packages are installed, False otherwise.
Return type:bool
static get_arches()[source]

Gets list of all known architectures

static get_header_from_rpm(rpm_name)[source]

Gets an RPM header from the given RPM package.

Parameters:rpm_name (str) – Path to the package.
Returns:Header object obtained from the package.
Return type:RpmHeader
classmethod get_rpm_spec(path: str, sourcedir: str, predefined_macros: Dict[str, str]) → <sphinx.ext.autodoc.importer._MockObject object at 0x7f9ce6d5f250>[source]
static install_build_dependencies(spec_path=None, assume_yes=False)[source]

Installs build dependencies of a package using dnf.

Parameters:
  • spec_path (str) – Absolute path to the SPEC file.
  • assume_yes (bool) – Whether to automatically answer ‘yes’ to all questions.
Returns:

Exit code of the subprocess run.

Return type:

int

static is_package_installed(pkg_name=None)[source]

Checks whether a package is installed.

Parameters:pkg_name (str) – Name of the package.
Returns:Whether the package is installed.
Return type:bool
classmethod parse_spec(path, flags=None)[source]
classmethod split_nevra(s)[source]

Splits string into name, epoch, version, release and arch components