Instead of using os.popen() directly, and passing a string then having
to quote the arguments, use subprocess.run() and pass a list of arguments.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/lib/oe/package.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 16359232ecd..f935b684de0 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -1625,11 +1625,11 @@ def process_shlibs(pkgfiles, d):
         sonames = set()
         renames = []
         ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
-        cmd = d.getVar('OBJDUMP') + " -p " + shlex.quote(file) + " 2>/dev/null"
-        fd = os.popen(cmd)
-        lines = fd.readlines()
-        fd.close()
         rpath = tuple()
+        cmd = [d.getVar("OBJDUMP"), "-p", file]
+        proc = subprocess.run(cmd, capture_output=True, text=True)
+        # Ignore errors silently as not all matching files will be parsed 
successfully
+        lines = proc.stdout.splitlines()
         for l in lines:
             m = re.match(r"\s+RPATH\s+([^\s]*)", l)
             if m:
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206506): 
https://lists.openembedded.org/g/openembedded-core/message/206506
Mute This Topic: https://lists.openembedded.org/mt/109280229/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to