summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-20 08:29:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-24 11:52:07 +0100
commitbcc03ea19e103f6aa93bada2f49fcc5cc7bc0790 (patch)
treebddbc6d8a3b7ea034e6cd1b377a4ab8bd5096206 /meta/lib/oe
parent6334129dfbe266602fab70ce445641053a05be6c (diff)
downloadopenembedded-core-contrib-bcc03ea19e103f6aa93bada2f49fcc5cc7bc0790.tar.gz
package: Don't use subshell to execute file
We don't need any functionality from the shell here, its just extra fork overhead. Therefore remove it and use subprocess directly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/package.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 4f3e21ad40..8a303106a9 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -56,7 +56,7 @@ def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, qa_already_stripped=
:param qa_already_stripped: Set to True if already-stripped' in ${INSANE_SKIP}
This is for proper logging and messages only.
"""
- import stat, errno, oe.path, oe.utils, mmap
+ import stat, errno, oe.path, oe.utils, mmap, subprocess
# Detect .ko module by searching for "vermagic=" string
def is_kernel_module(path):
@@ -72,11 +72,7 @@ def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, qa_already_stripped=
# 16 - kernel module
def is_elf(path):
exec_type = 0
- ret, result = oe.utils.getstatusoutput("file -b '%s'" % path)
-
- if ret:
- bb.error("split_and_strip_files: 'file %s' failed" % path)
- return exec_type
+ result = subprocess.check_output(["file", "-b", path], stderr=subprocess.STDOUT).decode("utf-8")
if "ELF" in result:
exec_type |= 1