aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package.py
diff options
context:
space:
mode:
authorStephano Cetola <stephano.cetola@linux.intel.com>2016-12-06 07:30:59 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-05 15:11:12 +0100
commit60ba1d424636bdd5700ec3ee0acec5c19550b884 (patch)
tree3c4995c1fa1686e0b1a61cb5b7ba05388aa8790e /meta/lib/oe/package.py
parentba59b6416f24ad53f1caccf9185b46cb60da213a (diff)
downloadopenembedded-core-60ba1d424636bdd5700ec3ee0acec5c19550b884.tar.gz
package_manager: remove strings and migrate to direct arrays
When using subprocess call and check_output, it is better to use arrays rather than strings when possible to avoid whitespace and quoting problems. [ YOCTO #9342 ] (From OE-Core rev: b12cec9a5ef14ecb02be7feec65508cf5d65c795) Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta/lib/oe/package.py')
-rw-r--r--meta/lib/oe/package.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 02642f29f0..ae60a5843e 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -18,23 +18,24 @@ def runstrip(arg):
newmode = origmode | stat.S_IWRITE | stat.S_IREAD
os.chmod(file, newmode)
- extraflags = ""
+ stripcmd = [strip]
# kernel module
if elftype & 16:
- extraflags = "--strip-debug --remove-section=.comment --remove-section=.note --preserve-dates"
+ stripcmd.extend(["--strip-debug", "--remove-section=.comment",
+ "--remove-section=.note", "--preserve-dates"])
# .so and shared library
elif ".so" in file and elftype & 8:
- extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded"
+ stripcmd.extend(["--remove-section=.comment", "--remove-section=.note", "--strip-unneeded"])
# shared or executable:
elif elftype & 8 or elftype & 4:
- extraflags = "--remove-section=.comment --remove-section=.note"
+ stripcmd.extend(["--remove-section=.comment", "--remove-section=.note"])
- stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
+ stripcmd.append(file)
bb.debug(1, "runstrip: %s" % stripcmd)
try:
- output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT, shell=True)
+ output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output))