]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
lib/packagedata.py: Add API to iterate over rprovides
authorJoshua Watt <JPEWhacker@gmail.com>
Wed, 20 Dec 2023 18:02:34 +0000 (11:02 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 24 Dec 2023 10:37:33 +0000 (10:37 +0000)
Adds an API that makes it easier to iterate over the package data for a
all providers of a runtime dependency.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/packagedata.py

index d59f6f5a569c263d25d46e1ad43b4aabae8d5104..2d1d6ddeb75e89c53bfcee552ba4fb75c702cc2a 100644 (file)
@@ -116,6 +116,21 @@ def recipename(pkg, d):
 
     return pkgmap(d).get(pkg)
 
+def foreach_runtime_provider_pkgdata(d, rdep, include_rdep=False):
+    pkgdata_dir = d.getVar("PKGDATA_DIR")
+    possibles = set()
+    try:
+        possibles |= set(os.listdir("%s/runtime-rprovides/%s/" % (pkgdata_dir, rdep)))
+    except OSError:
+        pass
+
+    if include_rdep:
+        possibles.add(rdep)
+
+    for p in sorted(list(possibles)):
+        rdep_data = read_subpkgdata(p, d)
+        yield p, rdep_data
+
 def get_package_mapping(pkg, basepkg, d, depversions=None):
     import oe.packagedata