All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Kent <sam.john.kent@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: mathieu.dubois-briand@bootlin.com,
	richard.purdie@linuxfoundation.org,
	Sam Kent <sam.john.kent@gmail.com>
Subject: [PATCH v5 1/3] oe-pkgdata-util: fix empty runtime-rprovides directory handling
Date: Tue,  5 May 2026 19:28:42 +0100	[thread overview]
Message-ID: <20260505182844.1136632-1-sam.john.kent@gmail.com> (raw)
In-Reply-To: <20260505170521.1129945-1-sam.john.kent@gmail.com>

An empty runtime-provides directory caused lookup-recipe, package-info
and list-pkg-files to skip the runtime-reverse fallback.

Use os.listdir() to ensure the folder is not empty and use
os.path.isdir( to ensure it is not a file.

Signed-off-by: Sam Kent <sam.john.kent@gmail.com>
---
 scripts/oe-pkgdata-util | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index bbfc6a2..904008b 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -289,8 +289,9 @@ def lookup_recipe(args):
 
     for pkg in pkgs:
         providepkgpath = os.path.join(args.pkgdata_dir, "runtime-rprovides", pkg)
-        if os.path.exists(providepkgpath):
-            for f in os.listdir(providepkgpath):
+        rprovides = os.listdir(providepkgpath) if os.path.isdir(providepkgpath) else []
+        if rprovides:
+            for f in rprovides:
                 if f != pkg:
                     print("%s is in the RPROVIDES of %s:" % (pkg, f))
                 pkgdatafile = os.path.join(args.pkgdata_dir, "runtime", f)
@@ -355,8 +356,9 @@ def package_info(args):
 
     for pkg in packages:
         providepkgpath = os.path.join(args.pkgdata_dir, "runtime-rprovides", pkg)
-        if os.path.exists(providepkgpath):
-            for f in os.listdir(providepkgpath):
+        rprovides = os.listdir(providepkgpath) if os.path.isdir(providepkgpath) else []
+        if rprovides:
+            for f in rprovides:
                 if f != pkg:
                     print("%s is in the RPROVIDES of %s:" % (pkg, f))
                 pkgdatafile = os.path.join(args.pkgdata_dir, "runtime", f)
@@ -507,8 +509,9 @@ def list_pkg_files(args):
 
         else:
             providepkgpath = os.path.join(args.pkgdata_dir, "runtime-rprovides", pkg)
-            if os.path.exists(providepkgpath):
-                for f in os.listdir(providepkgpath):
+            rprovides = os.listdir(providepkgpath) if os.path.isdir(providepkgpath) else []
+            if rprovides:
+                for f in rprovides:
                     if f != pkg:
                         print("%s is in the RPROVIDES of %s:" % (pkg, f))
                     pkgdatafile = os.path.join(args.pkgdata_dir, "runtime", f)
-- 
2.34.1



  parent reply	other threads:[~2026-05-05 18:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28  8:10 [PATCH v2 0/3] Fix .ko file pre-filter to use endswith instead of string contains Sam Kent
2026-04-28  8:10 ` [PATCH v2 1/3] package.py: fix kernel module file pre-filter and document strip asymmetry Sam Kent
2026-04-28  8:10 ` [PATCH v2 2/3] oe/package: add unit tests for kernel module detection helpers Sam Kent
2026-04-28 20:48   ` [OE-core] " Richard Purdie
2026-06-04 11:51   ` Richard Purdie
2026-04-28  8:10 ` [PATCH v2 3/3] oeqa/selftest: add oe-selftest for kernel module pre-filter Sam Kent
2026-04-29 12:45 ` [PATCH v3 1/2] oelib: add unit tests for kernel module detection helpers Sam Kent
2026-04-29 12:45   ` [PATCH v3 2/2] oeqa/selftest: add oe-selftest for kernel module pre-filter Sam Kent
2026-05-04  7:59     ` [OE-core] " Mathieu Dubois-Briand
2026-05-04  8:01       ` Mathieu Dubois-Briand
2026-05-05 12:35   ` [OE-core] [PATCH v3 1/2] oelib: add unit tests for kernel module detection helpers Mathieu Dubois-Briand
2026-05-05 17:05   ` [PATCH v4 1/3] oe-pkgdata-util: fix empty runtime-rprovides directory handling Sam Kent
2026-05-05 17:05     ` [PATCH v4 2/3] oelib: add unit tests for kernel module detection helpers Sam Kent
2026-05-05 17:05     ` [PATCH v4 3/3] oeqa/selftest: add oe-selftest for kernel module pre-filter Sam Kent
2026-05-05 17:17     ` Patchtest results for [PATCH v4 1/3] oe-pkgdata-util: fix empty runtime-rprovides directory handling patchtest
2026-05-05 18:28     ` Sam Kent [this message]
2026-05-05 18:28       ` [PATCH v5 2/3] oelib: add unit tests for kernel module detection helpers Sam Kent
2026-05-05 18:28       ` [PATCH v5 3/3] oeqa/selftest: add oe-selftest for kernel module pre-filter Sam Kent
2026-06-04 12:04         ` Paul Barker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260505182844.1136632-1-sam.john.kent@gmail.com \
    --to=sam.john.kent@gmail.com \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.