ahriman.core.alpm package
Subpackages
Submodules
ahriman.core.alpm.pacman module
- class Pacman(repository_id: RepositoryId, configuration: Configuration, *, refresh_database: PacmanSynchronization)
Bases:
LazyLogging
alpm wrapper
default constructor
- Parameters:
repository_id (RepositoryId) – repository unique identifier
configuration (Configuration) – configuration instance
refresh_database (PacmanSynchronization) – synchronize local cache to remote
- database_copy(handle: pyalpm.Handle, database: pyalpm.DB, pacman_root: Path, paths: RepositoryPaths, *, use_ahriman_cache: bool) None
copy database from the operating system root to the ahriman local home
- Parameters:
handle (Handle) – pacman handle which will be used for database copying
database (DB) – pacman database instance to be copied
pacman_root (Path) – operating system pacman root
paths (RepositoryPaths) – repository paths instance
use_ahriman_cache (bool) – use local ahriman cache instead of system one
- database_init(handle: pyalpm.Handle, repository: str, mirror: str, architecture: str) pyalpm.DB
create database instance from pacman handler and set its properties
- Parameters:
handle (Handle) – pacman handle which will be used for database initializing
repository (str) – pacman repository name (e.g. core)
mirror (str) – arch linux mirror url
architecture (str) – repository architecture
- Returns:
loaded pacman database instance
- Return type:
DB
- database_sync(handle: pyalpm.Handle, *, force: bool) None
sync local database
- Parameters:
handle (Handle) – pacman handle which will be used for database sync
force (bool) – force database synchronization (same as
pacman -Syy
)
- package_get(package_name: str) Generator[pyalpm.Package, None, None]
retrieve list of the packages from the repository by name
- Parameters:
package_name (str) – package name to search
- Yields:
Package – list of packages which were returned by the query
- packages() set[str]
get list of packages known for alpm
- Returns:
list of package names
- Return type:
set[str]
- property handle: pyalpm.Handle
pyalpm handle
- Returns:
generated pyalpm handle instance
- Return type:
Handle
ahriman.core.alpm.repo module
- class Repo(name: str, paths: RepositoryPaths, sign_args: list[str])
Bases:
LazyLogging
repo-add and repo-remove wrapper
- name
repository name
- Type:
str
- paths
repository paths instance
- Type:
- sign_args
additional args which have to be used to sign repository archive
- Type:
list[str]
- uid
uid of the repository owner user
- Type:
int
default constructor
- Parameters:
name (str) – repository name
paths (RepositoryPaths) – repository paths instance
sign_args (list[str]) – additional args which have to be used to sign repository archive
- add(path: Path) None
add new package to repository
- Parameters:
path (Path) – path to archive to add
- init() None
create empty repository database. It just calls add with empty arguments
- remove(package: str, filename: Path) None
remove package from repository
- Parameters:
package (str) – package name to remove
filename (Path) – package filename to remove
- property repo_path: Path
get full path to the repository database
- Returns:
path to repository database
- Return type:
Path