portage.repository.storage.inplace module

class portage.repository.storage.inplace.InplaceRepoStorage(repo, spawn_kwargs)

Bases: portage.repository.storage.interface.RepoStorageInterface

Legacy repo storage behavior, where updates are applied in-place. This module is not recommended, since the repository is left in an unspecified (possibly malicious) state if the update fails.

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