diff --git a/src/ahriman/core/alpm/repo.py b/src/ahriman/core/alpm/repo.py index 52c1c006..db8a79e0 100644 --- a/src/ahriman/core/alpm/repo.py +++ b/src/ahriman/core/alpm/repo.py @@ -59,22 +59,15 @@ class Repo(LazyLogging): """ return self.root / f"{self.name}.db.tar.gz" - def add(self, path: Path, *, remove: bool = True) -> None: + def add(self, path: Path) -> None: """ add new package to repository Args: path(Path): path to archive to add - remove(bool, optional): whether to remove old packages or not (Default value = True) """ - command = ["repo-add", *self.sign_args] - if remove: - command.extend(["--remove"]) - command.extend([str(self.repo_path), str(path)]) - - # add to repository check_output( - *command, + "repo-add", *self.sign_args, "--remove", str(self.repo_path), str(path), exception=BuildError.from_process(path.name), cwd=self.root, logger=self.logger, diff --git a/tests/ahriman/core/alpm/test_repo.py b/tests/ahriman/core/alpm/test_repo.py index 8e8ee61e..3543509d 100644 --- a/tests/ahriman/core/alpm/test_repo.py +++ b/tests/ahriman/core/alpm/test_repo.py @@ -35,17 +35,6 @@ def test_repo_add(repo: Repo, mocker: MockerFixture) -> None: assert "--remove" in check_output_mock.call_args[0] -def test_repo_add_no_remove(repo: Repo, mocker: MockerFixture) -> None: - """ - must call repo-add without remove flag - """ - check_output_mock = mocker.patch("ahriman.core.alpm.repo.check_output") - - repo.add(Path("path"), remove=False) - check_output_mock.assert_called_once() # it will be checked later - assert "--remove" not in check_output_mock.call_args[0] - - def test_repo_init(repo: Repo, mocker: MockerFixture) -> None: """ must call repo-add with empty package list on repo initializing