summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2018-08-21 21:28:52 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-23 07:45:32 +0100
commit7f9d2d16b8cdff9cbba2b3965c74d1c5b8ab1106 (patch)
tree4cd4730e72ed773abc109913b0077ed4b296a638
parenta3e9b2224b31cfd836519d0b609f8064adb67cca (diff)
downloadopenembedded-core-contrib-7f9d2d16b8cdff9cbba2b3965c74d1c5b8ab1106.tar.gz
openembedded-core-contrib-7f9d2d16b8cdff9cbba2b3965c74d1c5b8ab1106.tar.bz2
openembedded-core-contrib-7f9d2d16b8cdff9cbba2b3965c74d1c5b8ab1106.zip
classes/package: Clean up getstatusoutput
Replaces usage of the deprecated oe.utils.getstatusoutput() with Python subprocess calls. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/package.bbclass11
1 files changed, 3 insertions, 8 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 4ce9de2f57..323ba051ae 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -380,6 +380,7 @@ def splitdebuginfo(file, dvar, debugdir, debuglibdir, debugappend, debugsrcdir,
# sourcefile is also generated containing a list of debugsources
import stat
+ import subprocess
src = file[len(dvar):]
dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
@@ -409,16 +410,10 @@ def splitdebuginfo(file, dvar, debugdir, debuglibdir, debugappend, debugsrcdir,
bb.utils.mkdirhier(os.path.dirname(debugfile))
- cmd = "'%s' --only-keep-debug '%s' '%s'" % (objcopy, file, debugfile)
- (retval, output) = oe.utils.getstatusoutput(cmd)
- if retval:
- bb.fatal("objcopy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+ subprocess.check_output([objcopy, '--only-keep-debug', file, debugfile], stderr=subprocess.STDOUT)
# Set the debuglink to have the view of the file path on the target
- cmd = "'%s' --add-gnu-debuglink='%s' '%s'" % (objcopy, debugfile, file)
- (retval, output) = oe.utils.getstatusoutput(cmd)
- if retval:
- bb.fatal("objcopy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+ subprocess.check_output([objcopy, '--add-gnu-debuglink', debugfile, file], stderr=subprocess.STDOUT)
if newmode:
os.chmod(file, origmode)