feat: drop explicit makepkg usage (#134)

* generate filenames without using makepkg

* pkgbuild parser impl

* completely remove makepkg calls

* simplify typed get

* try to improve parser

* docs and recipes updatte

* never raise keyerror instead return empty string

* udpate tests

* add support of array expansion

* docs update

* tests update

* handle quoted control sequences correctly

* expand bash

* allow packages without package function

* docs update

* add moroe tests

* small improovements

* support escaped arrays and functions
This commit is contained in:
2024-09-21 03:56:14 +03:00
parent 1089bab526
commit 62320e8ec6
48 changed files with 2234 additions and 496 deletions

View File

@@ -132,6 +132,14 @@ def test_serialize_list() -> None:
assert PkgbuildPatch("key", ["val'ue", "val\"ue2"]).serialize() == """key=('val'"'"'ue' 'val"ue2')"""
def test_substitute() -> None:
"""
must correctly substitute variables
"""
assert PkgbuildPatch("key", "$env $value").substitute({"env": "variable"}) == "variable $value"
assert PkgbuildPatch("key", ["$env $value"]).substitute({"env": "variable"}) == ["variable $value"]
def test_write(mocker: MockerFixture) -> None:
"""
must write serialized value to the file