Compare commits

..

19 Commits

Author SHA1 Message Date
a2c755556a add moroe tests 2024-09-19 03:58:16 +03:00
aa9798973f docs update 2024-09-18 16:10:12 +03:00
bb587bcb17 allow packages without package function 2024-09-18 16:10:12 +03:00
12f6acc76c expand bash 2024-09-18 16:10:12 +03:00
54f905a537 handle quoted control sequences correctly 2024-09-18 16:10:12 +03:00
458c932fa7 tests update 2024-09-18 16:10:12 +03:00
4197de66e4 docs update 2024-09-18 16:10:12 +03:00
57afa87451 add support of array expansion 2024-09-18 16:10:12 +03:00
f46eea30a9 udpate tests 2024-09-18 16:10:12 +03:00
9c75ca09ec never raise keyerror instead return empty string 2024-09-18 16:10:12 +03:00
3c4ba46b51 docs and recipes updatte 2024-09-18 16:10:12 +03:00
a67a291b6e try to improve parser 2024-09-18 16:10:12 +03:00
3bf5e94098 simplify typed get 2024-09-18 16:10:12 +03:00
50d9cf5a6b completely remove makepkg calls 2024-09-18 16:10:12 +03:00
e293d4d354 pkgbuild parser impl 2024-09-18 16:10:12 +03:00
4afaeb7a9e generate filenames without using makepkg 2024-09-18 16:10:12 +03:00
3bdd2b618f bug: limit amount of fetches used for changes
The issue appears in case if - somehow - unknown commit sha has been
stored. In this scenario it would try to fetch infinitely
2024-09-18 16:08:59 +03:00
a075606330 feat: calculate changes on package addition as well 2024-09-18 14:03:52 +03:00
547357a705 bug: do not treat cached vcs packages as local 2024-09-17 18:02:32 +03:00
2 changed files with 27 additions and 7 deletions

View File

@ -66,7 +66,7 @@ class Repo(LazyLogging):
path(Path): path to archive to add
"""
check_output(
"repo-add", *self.sign_args, "-R", str(self.repo_path), str(path),
"repo-add", *self.sign_args, "--remove", str(self.repo_path), str(path),
exception=BuildError.from_process(path.name),
cwd=self.paths.repository,
logger=self.logger,
@ -76,8 +76,13 @@ class Repo(LazyLogging):
"""
create empty repository database. It just calls add with empty arguments
"""
check_output("repo-add", *self.sign_args, str(self.repo_path),
cwd=self.paths.repository, logger=self.logger, user=self.uid)
# 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)
def remove(self, package: str, filename: Path) -> None:
"""

View File

@ -26,13 +26,28 @@ def test_repo_add(repo: Repo, mocker: MockerFixture) -> None:
def test_repo_init(repo: Repo, mocker: MockerFixture) -> None:
"""
must call repo-add with empty package list on repo initializing
must create empty database files
"""
check_output_mock = mocker.patch("ahriman.core.alpm.repo.check_output")
mocker.patch("pathlib.Path.exists", return_value=False)
touch_mock = mocker.patch("pathlib.Path.touch")
symlink_mock = mocker.patch("pathlib.Path.symlink_to")
repo.init()
check_output_mock.assert_called_once() # it will be checked later
assert check_output_mock.call_args[0][0] == "repo-add"
touch_mock.assert_called_once_with(exist_ok=True)
symlink_mock.assert_called_once_with(repo.repo_path)
def test_repo_init_skip(repo: Repo, mocker: MockerFixture) -> None:
"""
must do not create files if database already exists
"""
mocker.patch("pathlib.Path.exists", return_value=True)
touch_mock = mocker.patch("pathlib.Path.touch")
symlink_mock = mocker.patch("pathlib.Path.symlink_to")
repo.init()
touch_mock.assert_not_called()
symlink_mock.assert_not_called()
def test_repo_remove(repo: Repo, mocker: MockerFixture) -> None: