diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2025-02-11 13:49:17 +0000 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-02-15 06:04:44 -0800 |
commit | 6f26093d1445a1d15730461b806d7e114e0760ba (patch) | |
tree | 49020daf77e2f8c9b0690230cb307bda60a1a70a | |
parent | 3d029078fe1b6af21ba753ad417b0511a7041f1c (diff) | |
download | poky-6f26093d1445a1d15730461b806d7e114e0760ba.tar.gz |
lib/packagedata.py: Add API to iterate over rprovides
Adds an API that makes it easier to iterate over the package data for a
all providers of a runtime dependency.
(From OE-Core rev: 68bdc219a4a819e83217f5b54c463624af8d3b9e)
(From OE-Core rev: 579717212ba2892e32315788ccd65320556d32a3)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/lib/oe/packagedata.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py index 212f048bc6..205800a407 100644 --- a/meta/lib/oe/packagedata.py +++ b/meta/lib/oe/packagedata.py | |||
@@ -108,3 +108,18 @@ def recipename(pkg, d): | |||
108 | """Return the recipe name for the given binary package name.""" | 108 | """Return the recipe name for the given binary package name.""" |
109 | 109 | ||
110 | return pkgmap(d).get(pkg) | 110 | return pkgmap(d).get(pkg) |
111 | |||
112 | def foreach_runtime_provider_pkgdata(d, rdep, include_rdep=False): | ||
113 | pkgdata_dir = d.getVar("PKGDATA_DIR") | ||
114 | possibles = set() | ||
115 | try: | ||
116 | possibles |= set(os.listdir("%s/runtime-rprovides/%s/" % (pkgdata_dir, rdep))) | ||
117 | except OSError: | ||
118 | pass | ||
119 | |||
120 | if include_rdep: | ||
121 | possibles.add(rdep) | ||
122 | |||
123 | for p in sorted(list(possibles)): | ||
124 | rdep_data = read_subpkgdata(p, d) | ||
125 | yield p, rdep_data | ||