[oe-commits] [openembedded-core] 26/103: uninative: use check_output instead of Popen directly

git at git.openembedded.org git at git.openembedded.org
Sun Feb 28 11:35:26 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 938687db0255d749ed8110d68628e505967b7131
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Tue Feb 23 21:10:13 2016 +0000

    uninative: use check_output instead of Popen directly
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/uninative.bbclass | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 7e225e6..270c1b0 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -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))
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list