Compare commits

..

21 Commits

Author SHA1 Message Date
a3fa46ddb9
Merge 7d543e2db2b8afdaf5ca79bdd126a9c847f0524a into 990397e1cb7b95b7c9d151e80a3ed6be8b22f96f 2024-09-19 22:49:24 +00:00
7d543e2db2 add moroe tests 2024-09-20 01:48:50 +03:00
286b015c32 docs update 2024-09-20 01:48:50 +03:00
1b6d6b5067 allow packages without package function 2024-09-20 01:48:50 +03:00
ad256b657f expand bash 2024-09-20 01:48:50 +03:00
e810709fa1 handle quoted control sequences correctly 2024-09-20 01:48:50 +03:00
83f0364802 tests update 2024-09-20 01:48:50 +03:00
79fba41f22 docs update 2024-09-20 01:48:50 +03:00
95b1cadfd0 add support of array expansion 2024-09-20 01:48:50 +03:00
4071425508 udpate tests 2024-09-20 01:48:50 +03:00
c3eeed6db8 never raise keyerror instead return empty string 2024-09-20 01:48:50 +03:00
18fbc38244 docs and recipes updatte 2024-09-20 01:48:50 +03:00
f200586e22 try to improve parser 2024-09-20 01:48:50 +03:00
5c64715dad simplify typed get 2024-09-20 01:48:50 +03:00
60ca40695f completely remove makepkg calls 2024-09-20 01:48:50 +03:00
5e2d11bd09 pkgbuild parser impl 2024-09-20 01:48:50 +03:00
0737d74570 generate filenames without using makepkg 2024-09-20 01:48:50 +03:00
990397e1cb Revert "fix: update Repo.init to the latest pacman release"
This reverts commit d30d512eb65b0a2fdadb5d97c1dba16ead7b4919.
2024-09-20 01:48:09 +03:00
300713f5d5 fix: 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-20 01:48:03 +03:00
9a17f19f7b feat: calculate changes on package addition as well 2024-09-20 01:48:03 +03:00
3ff1bf473c fix: do not treat cached vcs packages as local 2024-09-20 01:47:58 +03:00
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 path(Path): path to archive to add
""" """
check_output( 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), exception=BuildError.from_process(path.name),
cwd=self.paths.repository, cwd=self.paths.repository,
logger=self.logger, logger=self.logger,
@ -76,13 +76,8 @@ class Repo(LazyLogging):
""" """
create empty repository database. It just calls add with empty arguments 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 check_output("repo-add", *self.sign_args, str(self.repo_path),
# this code creates empty files instead cwd=self.paths.repository, logger=self.logger, user=self.uid)
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: def remove(self, package: str, filename: Path) -> None:
""" """

View File

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