Build helper module

exception rebasehelper.build_helper.BinaryPackageBuildError(*args, **kwargs)[source]

Error indicating failure to build Binary Package

class rebasehelper.build_helper.BuildTemporaryEnvironment(sources, patches, spec, results_dir)[source]

Class representing temporary environment.

TEMPDIR_RESULTS = 'TEMPDIR_RESULTS'
TEMPDIR_SOURCES = 'TEMPDIR_SOURCES'
TEMPDIR_SPEC = 'TEMPDIR_SPEC'
TEMPDIR_SPECS = 'TEMPDIR_SPECS'
class rebasehelper.build_helper.BuildToolBase[source]

Base class for various build tools

DEFAULT = False
classmethod accepts_options()[source]

Checks if the tool accepts additional command line options.

classmethod build(*args, **kwargs)[source]

Build binaries from the sources.

Keyword arguments: spec – path to a SPEC file sources – list with absolute paths to SOURCES patches – list with absolute paths to PATCHES results_dir – path to DIR where results should be stored

Returns: dict with: ‘srpm’ -> absolute path to SRPM ‘rpm’ -> list of absolute paths to RPMs ‘logs’ -> list of absolute paths to logs

classmethod creates_tasks()[source]

Checks if the tool creates build tasks.

classmethod get_build_tool_name()[source]

Returns the name of the build tool.

static get_builder_options(**kwargs)[source]
classmethod get_detached_task(task_id, results_dir)[source]

Gets packages and logs for specified task

Parameters:
  • task_id – detached task id
  • results_dir – path to DIR where results should be stored
Returns:

tuple with: list of absolute paths to RPMs list of absolute paths to logs

classmethod get_logs()[source]

Get logs from previously failed build Returns: dict with ‘logs’ -> list of absolute paths to logs

static get_srpm_builder_options(**kwargs)[source]
static get_srpm_buildtool(**kwargs)[source]
classmethod get_task_info(build_dict)[source]

Gets information about detached remote task

Parameters:build_dict – build data
Returns:task info
classmethod is_default()[source]

Checks if the tool is the default build tool.

classmethod match(cmd=None, *args, **kwargs)[source]

Checks if tool name matches the desired one.

classmethod prepare(spec, conf)[source]

Prepare for building.

Parameters:spec – spec file object
classmethod wait_for_task(build_dict, results_dir)[source]

Waits until specified task is finished

Parameters:
  • build_dict – build data
  • results_dir – path to DIR where results should be stored
Returns:

tuple with: list of absolute paths to RPMs list of absolute paths to logs

class rebasehelper.build_helper.Builder(tool=None)[source]

Class representing a process of building binaries from sources.

accepts_options()[source]
build(*args, **kwargs)[source]

Build sources.

build_tools = {'copr': <class 'rebasehelper.build_tools.copr_tool.CoprBuildTool'>, 'rpmbuild': <class 'rebasehelper.build_tools.rpmbuild_tool.RpmbuildBuildTool'>, 'mock': <class 'rebasehelper.build_tools.mock_tool.MockBuildTool'>}
creates_tasks()[source]
classmethod get_default_tool()[source]

Returns default build tool

get_detached_task(task_id, results_dir)[source]

Get detached task

get_logs()[source]

Get logs.

classmethod get_supported_tools()[source]

Returns a list of supported build tools

Returns:list of supported build tools
get_task_info(build_dict)[source]

Get task info

classmethod load_build_tools()[source]
prepare(spec, conf)[source]

Prepare for build

wait_for_task(build_dict, results_dir)[source]

Wait for task

class rebasehelper.build_helper.RpmbuildTemporaryEnvironment(sources, patches, spec, results_dir)[source]

Class representing temporary environment for RpmbuildBuildTool.

TEMPDIR_BUILD = 'TEMPDIR_BUILD'
TEMPDIR_BUILDROOT = 'TEMPDIR_BUILDROOT'
TEMPDIR_RPMBUILD = 'TEMPDIR_RPMBUILD'
TEMPDIR_RPMS = 'TEMPDIR_RPMS'
TEMPDIR_SRPMS = 'TEMPDIR_SRPMS'
class rebasehelper.build_helper.SRPMBuildToolBase[source]

Base class for SRPM builder tools

DEFAULT = False
classmethod build_srpm(spec, workdir, results_dir, srpm_builder_options)[source]

Build SRPM with chosen SRPM Build Tool

Parameters:
  • spec – abs path to SPEC file inside the rpmbuild/SPECS in workdir.
  • workdir – abs path to working directory with rpmbuild directory structure, which will be used as HOME dir.
  • results_dir – abs path to dir where the log should be placed.
  • srpm_builder_options – list of additional options to rpmbuild.
Returns:

If build process ends successfully returns abs path to built SRPM, otherwise ‘None’.

classmethod get_build_tool_name()[source]

Returns name of the SRPM Build Tool

classmethod is_default()[source]

Returns true if the SRPM Build Tool is set to be default

class rebasehelper.build_helper.SRPMBuilder[source]

Builder class for building SRPMs.

classmethod get_default_tool()[source]

Returns default build tool

classmethod get_supported_tools()[source]

Returns list of supported srpm build tools

classmethod load_srpm_build_tools()[source]
srpm_build_tools = {'rpmbuild': <class 'rebasehelper.srpm_build_tools.rpmbuild_tool.RpmbuildSRPMBuildTool'>, 'mock': <class 'rebasehelper.srpm_build_tools.mock_tool.MockSRPMBuildTool'>}
exception rebasehelper.build_helper.SourcePackageBuildError(*args, **kwargs)[source]

Error indicating failure to build Source Package.