portage.repository.storage.interface module

exception portage.repository.storage.interface.RepoStorageException(value)

Bases: portage.exception.PortageException

Base class for exceptions raise by RepoStorageInterface.

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class portage.repository.storage.interface.RepoStorageInterface(repo, spawn_kwargs)

Bases: object

Abstract repository storage interface.

Implementations can assume that the repo.location directory already exists with appropriate permissions (SyncManager handles this).

TODO: Add a method to check of a previous uncommitted update, which typically indicates a verification failure:

async abort_update()

Delete the current update directory. If there was not an update in progress, or it has already been committed, then this has no effect.

async commit_update()

Commit the current update directory, so that is becomes the latest immutable snapshot.

property current_update

Get the current update directory which would have been returned from the most recent call to the init_update method. This raises RepoStorageException if the init_update method has not been called.

Return type

str

Returns

path of directory to update

async garbage_collection()

Remove expired snapshots.

async init_update()

Create an update directory as a destination to sync updates to. The directory will be populated with files from the previous immutable snapshot, if available. Note that this directory may contain hardlinks that reference files in the previous immutable snapshot, so these files should not be modified (tools like rsync and git normally break hardlinks when files need to be modified).

Return type

str

Returns

path of directory to update, populated with files from the previous snapshot if available