transactions.package.portage

Provides portage related transactions.

Functions

simple_automation.transactions.package.portage.is_installed(context: simple_automation.context.Context, atom: str, packages: Optional[list] = None)

Queries whether or not the given package atom is installed on the remote.

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

  • atom (str) – The package name to query. Will be templated.

  • packages (list[str]) – Additional options to portage. Will be templated.

Returns

True if the package is installed

Return type

bool

simple_automation.transactions.package.portage.list_packages(context: simple_automation.context.Context)

Returns a dictionary of all installed packages on the remote system. The dictionary maps from “{category}/{name}” → any INFO_ATOMS → str/None

Parameters

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

Returns

All package atoms that are installed on the remote system.

Return type

list[str]

simple_automation.transactions.package.portage.package(context: simple_automation.context.Context, atom: str, state='present', oneshot=False, opts: Optional[list] = None)

Installs or uninstalls the given package atom (depending on state == “present” or “absent”). 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, optional) – The desired state, either “present” or “absent”. Defaults to “present”.

  • oneshot (bool, optional) – Use portage option –oneshot. Defaults to false.

  • opts (list[str]) – Additional options to portage. Will be templated.

Returns

The completed transaction

Return type

CompletedTransaction