pkgcore.operations.domain module

repository modifications (installing, removing, replacing)

exception pkgcore.operations.domain.Failure[source]

Bases: PkgcoreException

class pkgcore.operations.domain.base(domain, repo, observer, offset)[source]

Bases: object

clean_tempdir()[source]
create_engine()[source]
create_op()[source]
create_repo_op()[source]
customize_engine(engine)[source]
finalize_repo()[source]

finalize the repository operations

finish()[source]

finish the transaction

stage_depends = {}
stage_hooks = []
start()[source]

start the transaction

class pkgcore.operations.domain.install(domain, repo, pkg, observer, offset)[source]

Bases: base

base interface for installing a pkg into a livefs repo.

Repositories should override as needed.

create_engine()[source]
create_op()[source]
create_repo_op(**morekwargs)
static engine_kls(tempdir, pkg, offset=None, observer=None, disable_plugins=False)

Generate a MergeEngine instance configured for installing a pkg.

Parameters:
  • tempdir – tempspace for the merger to use; this space it must control alone, no sharing.

  • pkgpkgcore.package.metadata.package instance to install

  • offset – any livefs offset to force for modifications

  • disable_plugins – if enabled, run just the triggers passed in

Returns:

MergeEngine

finalize_repo(**morekwargs)

finalize the repository operations

finish(**morekwargs)

finish the transaction

format_install_op_name = '_repo_install_op'
postinst(**morekwargs)
preinst(**morekwargs)
repo_add(**morekwargs)
stage_depends = {'create_repo_op': 'transfer', 'finalize_repo': 'repo_add', 'finish': 'postinst', 'postinst': 'finalize_repo', 'preinst': 'start', 'repo_add': 'create_repo_op', 'transfer': 'preinst'}
stage_hooks = ['merge_metadata', 'postinst', 'preinst', 'transfer']
start(**morekwargs)

start the transaction

transfer(**morekwargs)
class pkgcore.operations.domain.replace(domain, repo, oldpkg, newpkg, observer, offset)[source]

Bases: install, uninstall

base interface for replacing a pkg in a livefs repo with another.

Repositories should override as needed.

create_engine()[source]
create_op()[source]
create_repo_op(**morekwargs)
static engine_kls(tempdir, old, new, offset=None, observer=None, disable_plugins=False)

Generate a MergeEngine instance configured for replacing a pkg.

Parameters:
  • tempdir – tempspace for the merger to use; this space it must control alone, no sharing.

  • oldpkgcore.package.metadata.package instance to replace, must be from a livefs vdb

  • newpkgcore.package.metadata.package instance

  • offset – any livefs offset to force for modifications

  • disable_plugins – if enabled, run just the triggers passed in

Returns:

MergeEngine

finalize_repo(**morekwargs)

finalize the repository operations

finish(**morekwargs)

finish the transaction

format_replace_op_name = '_repo_replace_op'
postinst(**morekwargs)
postrm(**morekwargs)
preinst(**morekwargs)
prerm(**morekwargs)
remove(**morekwargs)
repo_add(**morekwargs)
repo_remove(**morekwargs)
stage_depends = {'create_repo_op': 'transfer', 'finalize_repo': 'repo_remove', 'finish': 'postinst', 'postinst': 'postrm', 'postrm': 'finalize_repo', 'preinst': 'start', 'prerm': 'repo_add', 'remove': 'prerm', 'repo_add': 'create_repo_op', 'repo_remove': 'remove', 'transfer': 'preinst'}
stage_hooks = ['merge_metadata', 'unmerge_metadata', 'postrm', 'prerm', 'postinst', 'preinst', 'unmerge_metadata', 'merge_metadata']
start(**morekwargs)

start the transaction

transfer(**morekwargs)
class pkgcore.operations.domain.uninstall(domain, repo, pkg, observer, offset)[source]

Bases: base

base interface for uninstalling a pkg from a livefs repo.

Repositories should override as needed.

create_engine()[source]
create_op()[source]
create_repo_op(**morekwargs)
static engine_kls(tempdir, pkg, offset=None, observer=None, disable_plugins=False)

Generate a MergeEngine instance configured for uninstalling a pkg.

Parameters:
  • tempdir – tempspace for the merger to use; this space it must control alone, no sharing.

  • pkgpkgcore.package.metadata.package instance to uninstall, must be from a livefs vdb

  • offset – any livefs offset to force for modifications

  • disable_plugins – if enabled, run just the triggers passed in

Returns:

MergeEngine

finalize_repo(**morekwargs)

finalize the repository operations

finish(**morekwargs)

finish the transaction

format_uninstall_op_name = '_repo_uninstall_op'
postrm(**morekwargs)
prerm(**morekwargs)
remove(**morekwargs)
repo_remove(**morekwargs)
stage_depends = {'create_repo_op': 'start', 'finalize_repo': 'repo_remove', 'finish': 'postrm', 'postrm': 'finalize_repo', 'prerm': 'create_repo_op', 'remove': 'prerm', 'repo_remove': 'remove'}
stage_hooks = ['merge_metadata', 'postrm', 'prerm', 'remove']
start(**morekwargs)

start the transaction