From: Thomas Perrot <[email protected]> Commit 678c1c207731 applied os.path.isdir() + non-empty check to three functions, but the error-reporting path in lookup_pkg introduced by commit 46ff3a8d2c18 was left using os.path.exists() + os.listdir(). This is fragile: it raises NotADirectoryError if the path exists but is a file, and silently falls through to the generic error on an empty directory rather than skipping the rprovides block.
Apply the same pattern used elsewhere for consistency. Signed-off-by: Thomas Perrot <[email protected]> Signed-off-by: Mathieu Dubois-Briand <[email protected]> Signed-off-by: Richard Purdie <[email protected]> (cherry picked from commit dbca656205a7d9a9a9b0aa25b4ad6562af9c5180) Signed-off-by: Yoann Congal <[email protected]> --- scripts/oe-pkgdata-util | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index 904008bd029..acefae24f3a 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util @@ -239,8 +239,8 @@ def lookup_pkg(args): missing = list(set(pkgs) - set(mappings.keys())) for pkg in missing: providepkgpath = os.path.join(args.pkgdata_dir, "runtime-rprovides", pkg) - if os.path.exists(providepkgpath): - providers = os.listdir(providepkgpath) + providers = os.listdir(providepkgpath) if os.path.isdir(providepkgpath) else [] + if providers: for provider in providers: if provider == pkg: continue
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#237364): https://lists.openembedded.org/g/openembedded-core/message/237364 Mute This Topic: https://lists.openembedded.org/mt/119400575/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
