diff --git a/src/ahriman/core/alpm/pacman.py b/src/ahriman/core/alpm/pacman.py index d8911b55..0841dbaa 100644 --- a/src/ahriman/core/alpm/pacman.py +++ b/src/ahriman/core/alpm/pacman.py @@ -43,7 +43,7 @@ class Pacman(LazyLogging): configuration(Configuration): configuration instance refresh_database(PacmanSynchronization): synchronize local cache to remote repository_id(RepositoryId): repository unique identifier - repository_path(RepositoryPaths): repository paths instance + repository_paths(RepositoryPaths): repository paths instance """ def __init__(self, repository_id: RepositoryId, configuration: Configuration, *, @@ -188,8 +188,8 @@ class Pacman(LazyLogging): Returns: dict[str, set[str]]: map of package name to its list of files """ - def extract(tar: tarfile.TarFile, package_names: dict[str, str]) -> Generator[tuple[str, set[str]], None, None]: - for package_name, version in package_names.items(): + def extract(tar: tarfile.TarFile, versions: dict[str, str]) -> Generator[tuple[str, set[str]], None, None]: + for package_name, version in versions.items(): path = Path(f"{package_name}-{version}") / "files" try: content = tar.extractfile(str(path)) diff --git a/src/ahriman/core/alpm/pacman_database.py b/src/ahriman/core/alpm/pacman_database.py index 3c99f07c..70258b70 100644 --- a/src/ahriman/core/alpm/pacman_database.py +++ b/src/ahriman/core/alpm/pacman_database.py @@ -59,7 +59,8 @@ class PacmanDatabase(SyncHttpClient): self.sync_files_database = configuration.getboolean("alpm", "sync_files_database") - def copy(self, remote_path: Path, local_path: Path) -> None: + @staticmethod + def copy(remote_path: Path, local_path: Path) -> None: """ copy local database file diff --git a/src/ahriman/core/status/client.py b/src/ahriman/core/status/client.py index c8a3398e..3ef627ab 100644 --- a/src/ahriman/core/status/client.py +++ b/src/ahriman/core/status/client.py @@ -310,7 +310,7 @@ class Client: def set_unknown(self, package: Package) -> None: """ set package status to unknown. Unlike other methods, this method also checks if package is known, - and - in case if it is - it silently skips updatd + and - in case if it is - it silently skips update Args: package(Package): current package properties diff --git a/src/ahriman/models/repository_paths.py b/src/ahriman/models/repository_paths.py index 462f6076..738fd353 100644 --- a/src/ahriman/models/repository_paths.py +++ b/src/ahriman/models/repository_paths.py @@ -113,7 +113,7 @@ class RepositoryPaths(LazyLogging): Returns: Path: full patch to devtools chroot directory """ - # for the chroot directory devtools will create own tree, and we don"t have to specify architecture here + # for the chroot directory devtools will create own tree, and we don't have to specify architecture here return self.root / "chroot" / self.repository_id.name @property diff --git a/tests/ahriman/core/alpm/test_pacman_database.py b/tests/ahriman/core/alpm/test_pacman_database.py index 53a03c67..4b4fbfec 100644 --- a/tests/ahriman/core/alpm/test_pacman_database.py +++ b/tests/ahriman/core/alpm/test_pacman_database.py @@ -8,12 +8,12 @@ from ahriman.core.alpm.pacman_database import PacmanDatabase from ahriman.core.exceptions import PacmanError -def test_copy(pacman_database: PacmanDatabase, mocker: MockerFixture) -> None: +def test_copy(mocker: MockerFixture) -> None: """ must copy loca database file """ copy_mock = mocker.patch("shutil.copy") - pacman_database.copy(Path("remote"), Path("local")) + PacmanDatabase.copy(Path("remote"), Path("local")) copy_mock.assert_called_once_with(Path("remote"), Path("local"))