_emerge.EbuildBuild module

class _emerge.EbuildBuild.EbuildBuild(**kwargs)

Bases: _emerge.CompositeTask.CompositeTask

class _RecordBinpkgInfo(**kwargs)

Bases: _emerge.AsynchronousTask.AsynchronousTask

This class wraps the EbuildBuild _record_binpkg_info method with an AsynchronousTask interface, so that it can be scheduled as a member of a TaskSequence.

_async_wait()

Subclasses call this method in order to invoke exit listeners when self.returncode is set. Subclasses may override this method in order to perform cleanup. The default implementation for this method simply calls self.wait(), which will immediately raise an InvalidStateError if the event loop is running and self.returncode is None.

_cancel()

Subclasses should implement this, as a template method to be called by AsynchronousTask.cancel().

_cancelled_returncode = -2
_exit_listener_cb(listener)
_exit_listener_handles
_exit_listeners
_poll()
_start()
_start_hook()
_start_listeners
_wait_hook()

Call this method after the task completes, just before returning the returncode from wait() or poll(). This hook is used to trigger exit listeners when the returncode first becomes available.

_was_cancelled()

If cancelled, set returncode if necessary and return True. Otherwise, return False.

addExitListener(f)

The function will be called with one argument, a reference to self.

addStartListener(f)

The function will be called with one argument, a reference to self.

async_wait()

Wait for returncode asynchronously. Notification is available via the add_done_callback method of the returned Future instance.

Returns

Future, result is self.returncode

background
cancel()

Cancel the task, but do not wait for exit status. If asynchronous exit notification is desired, then use addExitListener to add a listener before calling this method. NOTE: Synchronous waiting for status is not supported, since it would be vulnerable to hitting the recursion limit when a large number of tasks need to be terminated simultaneously, like in bug #402335.

cancelled
copy()

Create a new instance and copy all attributes defined from __slots__ (including those from inherited classes).

ebuild_binpkg
ebuild_build
isAlive()
poll()
removeExitListener(f)
removeStartListener(f)
returncode
scheduler
start()

Start an asynchronous task and then return as soon as possible.

wait()

Wait for the returncode attribute to become ready, and return it. If the returncode is not ready and the event loop is already running, then the async_wait() method should be used instead of wait(), because wait() will raise asyncio.InvalidStateError in this case.

Return type

int

Returns

the value of self.returncode

_TASK_QUEUED = -1
_assert_current(task)

Raises an AssertionError if the given task is not the same one as self._current_task. This can be useful for detecting bugs.

_async_unlock_builddir(returncode=None)

Release the lock asynchronously, and if a returncode parameter is given then set self.returncode and notify exit listeners.

_async_wait()

Subclasses call this method in order to invoke exit listeners when self.returncode is set. Subclasses may override this method in order to perform cleanup. The default implementation for this method simply calls self.wait(), which will immediately raise an InvalidStateError if the event loop is running and self.returncode is None.

_build_dir
_build_exit(build)
_buildpkg
_buildpkg_exit(packager)

Released build dir lock when there is a failure or when in buildpkgonly mode. Otherwise, the lock will be released when merge() is called.

_buildpkgonly_success_hook_exit(success_hooks)
_cancel()

Subclasses should implement this, as a template method to be called by AsynchronousTask.cancel().

_cancelled_returncode = -2
_check_manifest()
_clean_exit(clean_phase)
_current_task
_default_exit(task)

Calls _assert_current() on the given task and then sets the composite returncode attribute if task.returncode != os.EX_OK. If the task failed then self._current_task will be set to None. Subclasses can use this as a generic task exit callback.

Return type

int

Returns

The task.returncode attribute.

_default_final_exit(task)

This calls _final_exit() and then wait().

Subclasses can use this as a generic final task exit callback.

_ebuild_path
_exit_listener_cb(listener)
_exit_listener_handles
_exit_listeners
_fetch_exit(fetcher)
_fetch_failed()
_fetchonly_exit(fetcher)
_final_exit(task)

Assumes that task is the final task of this composite task. Calls _default_exit() and sets self.returncode to the task’s returncode and sets self._current_task to None.

_install_exit(task)
Returns

Future, result is the returncode from an EbuildBuildDir.async_unlock() task

_issyspkg
_nofetch_exit(nofetch_phase)
_nofetch_without_builddir_exit(nofetch)
_poll()

This does a loop calling self._current_task.poll() repeatedly as long as the value of self._current_task keeps changing. It calls poll() a maximum of one time for a given self._current_task instance. This is useful since calling poll() on a task can trigger advance to the next task could eventually lead to the returncode being set in cases when polling only a single task would not have the same effect.

_pre_clean_exit(pre_clean_phase)
_prefetch_exit(prefetcher)
_record_binpkg_info(task)
_start()
_start_fetch(fetcher, already_fetched_task)
_start_hook()
_start_listeners
_start_pre_clean(lock_task)
_start_task(task, exit_handler)

Register exit handler for the given task, set it as self._current_task, and call task.start().

Subclasses can use this as a generic way to start a task.

_start_with_metadata(aux_get_task)
_task_queued(task)
_task_queued_start_handler(task)
_task_queued_wait()
_tree
_unlock_builddir_exit(unlock_task, returncode=None)
_wait_hook()

Call this method after the task completes, just before returning the returncode from wait() or poll(). This hook is used to trigger exit listeners when the returncode first becomes available.

_was_cancelled()

If cancelled, set returncode if necessary and return True. Otherwise, return False.

addExitListener(f)

The function will be called with one argument, a reference to self.

addStartListener(f)

The function will be called with one argument, a reference to self.

args_set
async_wait()

Wait for returncode asynchronously. Notification is available via the add_done_callback method of the returned Future instance.

Returns

Future, result is self.returncode

background
cancel()

Cancel the task, but do not wait for exit status. If asynchronous exit notification is desired, then use addExitListener to add a listener before calling this method. NOTE: Synchronous waiting for status is not supported, since it would be vulnerable to hitting the recursion limit when a large number of tasks need to be terminated simultaneously, like in bug #402335.

cancelled
config_pool
copy()

Create a new instance and copy all attributes defined from __slots__ (including those from inherited classes).

create_install_task()

Install the package and then clean up and release locks. Only call this after the build has completed successfully and neither fetchonly nor buildpkgonly mode are enabled.

find_blockers
isAlive()
ldpath_mtimes
logger
opts
pkg
pkg_count
poll()
prefetcher
removeExitListener(f)
removeStartListener(f)
returncode
scheduler
settings
start()

Start an asynchronous task and then return as soon as possible.

wait()

Wait for the returncode attribute to become ready, and return it. If the returncode is not ready and the event loop is already running, then the async_wait() method should be used instead of wait(), because wait() will raise asyncio.InvalidStateError in this case.

Return type

int

Returns

the value of self.returncode

world_atom