build: package: add subpkg depends (MR 2377)

Recurse dependencies of subpackages too.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-07-19 16:58:26 +02:00
parent f07ceca9c6
commit 6002a73329
No known key found for this signature in database
GPG key ID: 0583312B195F64B6

View file

@ -82,6 +82,12 @@ def get_depends(context: Context, apkbuild):
ret += apkbuild["checkdepends"]
if not context.ignore_depends:
ret += apkbuild["depends"]
for subpkgname, subpkg in apkbuild["subpackages"].items():
if not subpkg:
continue
logging.verbose(f"{apkbuild['pkgname']}: adding subpackage depends: {subpkgname}")
ret += subpkg["depends"]
ret = sorted(set(ret))
# Don't recurse forever when a package depends on itself (#948)