summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-08-25 16:37:50 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2009-08-25 16:37:50 +0100
commitc2b4308119d32c07e9c7a120e06b78afd26ff58c (patch)
treedeff0f578769c65dbca652e00a508deb2a1540ba /meta/classes
parent7859b4c9bd0e62cc220faf74c8c51ed6e46f405b (diff)
downloadpoky-c2b4308119d32c07e9c7a120e06b78afd26ff58c.tar.gz
base.bbclass: Use subprocess rather than os.system for do_unpack
gzip reports broken pipe errors with do_unpack on Fedora with certain builds of gzip and bash. By avoding python's SIGPIPE handler we can work correctly on these distributions. Patch based on a patch from the OE-devel mailing list, thanks to Khem Raj <raj.khem@gmail.com> and Holger Freyther <zecke@selfish.org> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/base.bbclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 3704cce01a..4f1e2dd788 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -627,8 +627,16 @@ base_do_buildall() {
627} 627}
628 628
629 629
630
631def subprocess_setup():
632 import signal
633 # Python installs a SIGPIPE handler by default. This is usually not what
634 # non-Python subprocesses expect.
635 # SIGPIPE errors are known issues with gzip/bash
636 signal.signal(signal.SIGPIPE, signal.SIG_DFL)
637
630def oe_unpack_file(file, data, url = None): 638def oe_unpack_file(file, data, url = None):
631 import bb, os 639 import bb, os, subprocess
632 if not url: 640 if not url:
633 url = "file://%s" % file 641 url = "file://%s" % file
634 dots = file.split(".") 642 dots = file.split(".")
@@ -694,7 +702,7 @@ def oe_unpack_file(file, data, url = None):
694 702
695 cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd) 703 cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd)
696 bb.note("Unpacking %s to %s/" % (file, os.getcwd())) 704 bb.note("Unpacking %s to %s/" % (file, os.getcwd()))
697 ret = os.system(cmd) 705 ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True)
698 706
699 os.chdir(save_cwd) 707 os.chdir(save_cwd)
700 708