portage.repository.storage.hardlink_quarantine module¶
- class portage.repository.storage.hardlink_quarantine.HardlinkQuarantineRepoStorage(repo, spawn_kwargs)¶
Bases:
portage.repository.storage.interface.RepoStorageInterface
This is the default storage module, since its quite compatible with most configurations.
It’s desirable to be able to create shared hardlinks between the download directory and the normal repository, and this is facilitated by making the download directory be a subdirectory of the normal repository location (ensuring that no mountpoints are crossed). Shared hardlinks are created by using the rsync –link-dest option.
Since the download is initially unverified, it is safest to save it in a quarantine directory. The quarantine directory is also useful for making the repository update more atomic, so that it less likely that normal repository location will be observed in a partially synced state.
- async _check_call(cmd)¶
Run cmd and raise RepoStorageException on failure.
- Parameters
cmd (list) – command to executre
- 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