]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
uninative: use check_output instead of Popen directly
authorRoss Burton <ross.burton@intel.com>
Tue, 23 Feb 2016 21:10:13 +0000 (21:10 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 28 Feb 2016 11:32:35 +0000 (11:32 +0000)
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/uninative.bbclass

index 7e225e6f15007cf5feb48e59ddce759b133e69f0..270c1b0be4f965728ecebaa7e3ac997dc00fd3a7 100644 (file)
@@ -83,12 +83,10 @@ python uninative_changeinterp () {
             except oe.qa.NotELFFileError:
                 continue
 
-            #bb.warn("patchelf-uninative --set-interpreter %s %s" % (d.getVar("UNINATIVE_LOADER", True), f))
-            cmd = "patchelf-uninative --set-interpreter %s %s" % (d.getVar("UNINATIVE_LOADER", True), f)
-            p = subprocess.Popen(cmd, shell=True,
-                                 stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-            stdout, stderr = p.communicate()
-            if p.returncode:
+            try:
+                subprocess.check_output(("patchelf-uninative", "--set-interpreter",
+                                         d.getVar("UNINATIVE_LOADER", True), f))
+            except subprocess.CalledProcessError as e:
                 bb.fatal("'%s' failed with exit code %d and the following output:\n%s" %
-                         (cmd, p.returncode, stdout))
+                         (e.cmd, e.returncode, e.output))
 }