ahriman.core.repository package
Submodules
ahriman.core.repository.cleaner module
- class Cleaner(repository_id: RepositoryId, configuration: Configuration, database: SQLite, *, report: bool, refresh_pacman_database: PacmanSynchronization)
Bases:
RepositoryProperties
trait to clean common repository objects
default constructor
- Parameters:
repository_id (RepositoryId) – repository unique identifier
configuration (Configuration) – configuration instance
database (SQLite) – database instance
report (bool) – force enable or disable reporting
refresh_pacman_database (PacmanSynchronization) – pacman database synchronization level
- clear_cache() None
clear cache directory
- clear_chroot() None
clear cache directory. Warning: this method is architecture independent and will clear every chroot
- clear_packages() None
clear directory with built packages (NOT repository itself)
- clear_pacman() None
clear directory with pacman databases
- clear_queue() None
clear packages which were queued for the update
- packages_built() list[Path]
get list of files in built packages directory
- Returns:
list of filenames from the directory
- Return type:
list[Path]
- Raises:
NotImplementedError – not implemented method
ahriman.core.repository.executor module
- class Executor(repository_id: RepositoryId, configuration: Configuration, database: SQLite, *, report: bool, refresh_pacman_database: PacmanSynchronization)
Bases:
PackageInfo
,Cleaner
trait for common repository update processes
default constructor
- Parameters:
repository_id (RepositoryId) – repository unique identifier
configuration (Configuration) – configuration instance
database (SQLite) – database instance
report (bool) – force enable or disable reporting
refresh_pacman_database (PacmanSynchronization) – pacman database synchronization level
- process_build(updates: Iterable[Package], packagers: Packagers | None = None, *, bump_pkgrel: bool = False) Result
build packages
- Parameters:
- Returns:
build result
- Return type:
- process_remove(packages: Iterable[str]) Result
remove packages from list
- Parameters:
packages (Iterable[str]) – list of package names or bases to remove
- Returns:
remove result
- Return type:
ahriman.core.repository.package_info module
- class PackageInfo(repository_id: RepositoryId, configuration: Configuration, database: SQLite, *, report: bool, refresh_pacman_database: PacmanSynchronization)
Bases:
RepositoryProperties
handler for the package information
default constructor
- Parameters:
repository_id (RepositoryId) – repository unique identifier
configuration (Configuration) – configuration instance
database (SQLite) – database instance
report (bool) – force enable or disable reporting
refresh_pacman_database (PacmanSynchronization) – pacman database synchronization level
- load_archives(packages: Iterable[Path]) list[Package]
load packages from list of archives
- Parameters:
packages (Iterable[Path]) – paths to package archives
- Returns:
list of read packages
- Return type:
list[Package]
- package_changes(package: Package, last_commit_sha: str | None) Changes
extract package change for the package since last commit if available
- packages(filter_packages: Iterable[str] | None = None) list[Package]
generate list of repository packages
- Parameters:
filter_packages (Iterable[str] | None, optional) – filter packages list by specified only
- Returns:
list of packages properties
- Return type:
list[Package]
- packages_built() list[Path]
get list of files in built packages directory
- Returns:
list of filenames from the directory
- Return type:
list[Path]
ahriman.core.repository.repository module
- class Repository(repository_id: RepositoryId, configuration: Configuration, database: SQLite, *, report: bool, refresh_pacman_database: PacmanSynchronization)
Bases:
Executor
,UpdateHandler
base repository control class
Examples
This class along with traits provides access to local repository actions, e.g. remove packages, update packages, sync local repository to remote, generate report, etc.:
>>> from ahriman.core.configuration import Configuration >>> from ahriman.core.database import SQLite >>> >>> configuration = Configuration() >>> database = SQLite.load(configuration) >>> repository = Repository.load(RepositoryId("x86_64", "x86_64"), configuration, database, report=True) >>> known_packages = repository.packages() >>> >>> build_result = repository.process_build(known_packages) >>> built_packages = repository.packages_built() >>> update_result = repository.process_update(built_packages) >>> >>> repository.triggers.on_result(update_result, repository.packages())
default constructor
- Parameters:
repository_id (RepositoryId) – repository unique identifier
configuration (Configuration) – configuration instance
database (SQLite) – database instance
report (bool) – force enable or disable reporting
refresh_pacman_database (PacmanSynchronization) – pacman database synchronization level
- classmethod load(repository_id: RepositoryId, configuration: Configuration, database: SQLite, *, report: bool, refresh_pacman_database: PacmanSynchronization = PacmanSynchronization.Disabled) Self
load instance from argument list
- Parameters:
repository_id (RepositoryId) – repository unique identifier
configuration (Configuration) – configuration instance
database (SQLite) – database instance
report (bool) – force enable or disable reporting
refresh_pacman_database (PacmanSynchronization, optional) – pacman database synchronization level (Default value = PacmanSynchronization.Disabled)
- Returns:
fully loaded repository class instance
- Return type:
Self
ahriman.core.repository.repository_properties module
- class RepositoryProperties(repository_id: RepositoryId, configuration: Configuration, database: SQLite, *, report: bool, refresh_pacman_database: PacmanSynchronization)
Bases:
LazyLogging
repository internal objects holder
- configuration
configuration instance
- Type:
- ignore_list
package bases which will be ignored during auto updates
- Type:
list[str]
- paths
repository paths instance
- Type:
- repository_id
repository unique identifier
- Type:
- triggers
triggers holder
- Type:
- vcs_allowed_age
maximal age of the VCS packages before they will be checked
- Type:
int
default constructor
- Parameters:
repository_id (RepositoryId) – repository unique identifier
configuration (Configuration) – configuration instance
database (SQLite) – database instance
report (bool) – force enable or disable reporting
refresh_pacman_database (PacmanSynchronization) – pacman database synchronization level
- packager(packagers: Packagers, package_base: str) User
extract packager from configuration having username
- property architecture: str
repository architecture for backward compatibility
- Returns:
repository architecture
- Return type:
str
- property name: str
repository name for backward compatibility
- Returns:
repository name
- Return type:
str
ahriman.core.repository.update_handler module
- class UpdateHandler(repository_id: RepositoryId, configuration: Configuration, database: SQLite, *, report: bool, refresh_pacman_database: PacmanSynchronization)
Bases:
PackageInfo
,Cleaner
trait to get package update list
default constructor
- Parameters:
repository_id (RepositoryId) – repository unique identifier
configuration (Configuration) – configuration instance
database (SQLite) – database instance
report (bool) – force enable or disable reporting
refresh_pacman_database (PacmanSynchronization) – pacman database synchronization level
- updates_aur(filter_packages: Iterable[str], *, vcs: bool) list[Package]
check AUR for updates
- Parameters:
filter_packages (Iterable[str]) – do not check every package just specified in the list
vcs (bool) – enable or disable checking of VCS packages
- Returns:
list of packages which are out-of-dated
- Return type:
list[Package]
- updates_dependencies(filter_packages: Iterable[str]) list[Package]
check packages which ae required to be rebuilt based on dynamic dependencies (e.g. linking, modules paths, etc.)
- Parameters:
filter_packages (Iterable[str]) – do not check every package just specified in the list
- Returns:
list of packages for which there is breaking linking
- Return type:
list[Package]