PacmanRepository¶
- class rmote.tools.pacman_repository.PacmanRepository[source]¶
Bases:
ToolManage Arch Linux repository sections and GPG keys.
Repository sections are read from and written to
/etc/pacman.conf. GPG key files are stored in/etc/pacman.d/. All operations are idempotent and require root.- static absent(name)[source]¶
Remove the repository section name from
/etc/pacman.conf.- Parameters:
name (
Text) – Repository section name to remove.- Return type:
Result- Returns:
Resultindicating whetherpacman.confwas modified.
- static key(name, data)[source]¶
Write a GPG key to
/etc/pacman.d/{name}.Idempotent — the file is left untouched if it already contains identical bytes.
- static present(name, *, servers, sig_level='Optional TrustAll')[source]¶
Ensure a repository section is present in
/etc/pacman.conf.If the section already exists with the same content it is left unchanged. If it exists with different content it is updated in-place. Otherwise it is appended at the end of the file.