summaryrefslogtreecommitdiffstats
path: root/meta/classes
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:50:00 +0100
commita24081dd28bdb5676cfb3505b7f042fba38c74f9 (patch)
tree4b1ad759f7c4e6a2b4d7d17747fbb22367d3bb72 /meta/classes
parente8934a29c3395e21292e28ff06083d25e0602710 (diff)
downloadpoky-a24081dd28bdb5676cfb3505b7f042fba38c74f9.tar.gz
classes/package: Clean up getstatusoutput
Replaces usage of the deprecated oe.utils.getstatusoutput() with Python subprocess calls. (From OE-Core rev: 7f9d2d16b8cdff9cbba2b3965c74d1c5b8ab1106) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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,
380 # sourcefile is also generated containing a list of debugsources 380 # sourcefile is also generated containing a list of debugsources
381 381
382 import stat 382 import stat
383 import subprocess
383 384
384 src = file[len(dvar):] 385 src = file[len(dvar):]
385 dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend 386 dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
@@ -409,16 +410,10 @@ def splitdebuginfo(file, dvar, debugdir, debuglibdir, debugappend, debugsrcdir,
409 410
410 bb.utils.mkdirhier(os.path.dirname(debugfile)) 411 bb.utils.mkdirhier(os.path.dirname(debugfile))
411 412
412 cmd = "'%s' --only-keep-debug '%s' '%s'" % (objcopy, file, debugfile) 413 subprocess.check_output([objcopy, '--only-keep-debug', file, debugfile], stderr=subprocess.STDOUT)
413 (retval, output) = oe.utils.getstatusoutput(cmd)
414 if retval:
415 bb.fatal("objcopy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
416 414
417 # Set the debuglink to have the view of the file path on the target 415 # Set the debuglink to have the view of the file path on the target
418 cmd = "'%s' --add-gnu-debuglink='%s' '%s'" % (objcopy, debugfile, file) 416 subprocess.check_output([objcopy, '--add-gnu-debuglink', debugfile, file], stderr=subprocess.STDOUT)
419 (retval, output) = oe.utils.getstatusoutput(cmd)
420 if retval:
421 bb.fatal("objcopy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
422 417
423 if newmode: 418 if newmode:
424 os.chmod(file, origmode) 419 os.chmod(file, origmode)