forked from Mirror/pmbootstrap
pmb.parse._apkbuild: Extend APKBUILD parser to work for subpackages (!1866)
At the moment we have a simple subpkgdesc() function that can only parse "pkgdesc" from subpackages, without support for any variables. But we have a quite nice variable parser now that can be extended to work for subpackages. Simply put this works by: - Finding the lines that belong to the subpackage function - Stripping indentation (tab) - Parsing relevant attributes similar to the apkbuild() function The "subpackages" in the parsed APKBUILD are replaced by a dict of subpkgname: {"pkgdesc": "...", "depends": "..."} which are parsed from the subpackage function (if found). This makes it possible to get the "depends" of a subpackage.
This commit is contained in:
parent
0dad22a112
commit
0e27713512
12 changed files with 178 additions and 104 deletions
|
@ -49,7 +49,7 @@ def test_helpers_package_get_pmaports_and_cache(args, monkeypatch):
|
|||
"provides": ["testprovide"],
|
||||
"options": [],
|
||||
"checkdepends": [],
|
||||
"subpackages": [],
|
||||
"subpackages": {},
|
||||
"makedepends": [],
|
||||
"pkgver": "1.0",
|
||||
"pkgrel": "1"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue