transactions.package.utils

Provides package related utils.

Functions

simple_automation.transactions.package.utils.generic_package(context: simple_automation.context.Context, atom: str, state: str, is_installed, install, uninstall)

Installs or uninstalls (depending if state == “present” or “absent”) the given package atom. Additional options to emerge can be passed via opts, and will be appended before the package atom. opts will be templated.

Parameters
  • context (Context) – The context providing the execution context and templating dictionary.

  • atom (str) – The package name to be installed or uninstalled. Will be templated.

  • state (str) – The desired state, either “present” or “absent”.

  • is_installed (Callable[[Context, str], bool]) – Callback used to determine if a given package is installed.

  • install (Callable[[Context, str], None]) – Callback used to install a package on the remote.

  • uninstall (Callable[[Context, str], None]) – Callback used to uninstall a package on the remote.

Returns

The completed transaction

Return type

CompletedTransaction