Revert "fix: update Repo.init to the latest pacman release"

This reverts commit 99ca0cb2fd.
This commit is contained in:
2024-09-20 01:42:46 +03:00
parent 5316427371
commit fbbb80d091
2 changed files with 7 additions and 27 deletions

View File

@ -66,7 +66,7 @@ class Repo(LazyLogging):
path(Path): path to archive to add
"""
check_output(
"repo-add", *self.sign_args, "--remove", str(self.repo_path), str(path),
"repo-add", *self.sign_args, "-R", str(self.repo_path), str(path),
exception=BuildError.from_process(path.name),
cwd=self.paths.repository,
logger=self.logger,
@ -76,13 +76,8 @@ class Repo(LazyLogging):
"""
create empty repository database. It just calls add with empty arguments
"""
# since pacman-6.1.0 repo-add doesn't create empty database in case if no packages supplied
# this code creates empty files instead
if self.repo_path.exists():
return # database is already created, skip this part
self.repo_path.touch(exist_ok=True)
(self.paths.repository / f"{self.name}.db").symlink_to(self.repo_path)
check_output("repo-add", *self.sign_args, str(self.repo_path),
cwd=self.paths.repository, logger=self.logger, user=self.uid)
def remove(self, package: str, filename: Path) -> None:
"""