* [PATCH] oe-pkgdata-util: improve lookup-pkg error for RPROVIDES packages
@ 2026-04-08 17:12 Zk47T
0 siblings, 0 replies; only message in thread
From: Zk47T @ 2026-04-08 17:12 UTC (permalink / raw)
To: openembedded-core; +Cc: zizuzacker
When a package is not found by 'oe-pkgdata-util lookup-pkg', the error
message provides no guidance on what went wrong or where to look.
Improve the error message by checking the runtime-rprovides directory
for the missing package. If the package exists in RPROVIDES:
- If the provider package was generated, suggest looking up the actual
package name instead.
- If the provider package was not generated (e.g. empty package or
disabled by PACKAGECONFIG), inform the user which recipe provides it
and that it was not generated.
This helps users quickly identify the correct package name or
understand why a package is missing from their build.
Before:
ERROR: The following packages could not be found: eglibc
After:
ERROR: eglibc is in the RPROVIDES of glibc (recipe: glibc), try
looking up 'glibc' instead
[YOCTO #16083]
Signed-off-by: Zk47T <zizuzacker@gmail.com>
---
scripts/oe-pkgdata-util | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 44ae40549a..bbfc6a2ddd 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -237,7 +237,27 @@ def lookup_pkg(args):
if len(mappings) < len(pkgs):
missing = list(set(pkgs) - set(mappings.keys()))
- logger.error("The following packages could not be found: %s" % ', '.join(missing))
+ for pkg in missing:
+ providepkgpath = os.path.join(args.pkgdata_dir, "runtime-rprovides", pkg)
+ if os.path.exists(providepkgpath):
+ providers = os.listdir(providepkgpath)
+ for provider in providers:
+ if provider == pkg:
+ continue
+ pn = ""
+ pkgdatafile = os.path.join(args.pkgdata_dir, "runtime", provider)
+ if os.path.exists(pkgdatafile):
+ with open(pkgdatafile, 'r') as f:
+ for line in f:
+ if line.startswith('PN:'):
+ pn = line.split(':', 1)[1].strip()
+ break
+ if os.path.exists(os.path.join(args.pkgdata_dir, "runtime", "%s.packaged" % provider)):
+ logger.error("%s is in the RPROVIDES of %s (recipe: %s), try looking up '%s' instead" % (pkg, provider, pn or "unknown", provider))
+ else:
+ logger.error("%s is in the RPROVIDES of %s (recipe: %s), but the package was not generated (e.g. empty package or disabled PACKAGECONFIG)" % (pkg, provider, pn or "unknown"))
+ else:
+ logger.error("The following packages could not be found: %s" % pkg)
sys.exit(1)
if args.reverse:
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-08 17:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 17:12 [PATCH] oe-pkgdata-util: improve lookup-pkg error for RPROVIDES packages Zk47T
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox