diff options
author | Cory Maccarrone <darkstar6262@gmail.com> | 2009-11-21 19:52:15 +0000 |
---|---|---|
committer | Marcin Juszkiewicz <marcin@buglabs.net> | 2009-12-02 16:38:42 +0100 |
commit | b14468b964257dd02c95cfdc330fe5336a72c4d0 (patch) | |
tree | 41f6b13d1f6d87bfe4f5da1ab81c912a7da95904 | |
parent | fdfedf718dd484607f1b1b839e5e9608406e02e4 (diff) | |
download | openembedded-b14468b964257dd02c95cfdc330fe5336a72c4d0.tar.gz |
base.bbclass: Replace os.system with subprocess call.
(This patch is being submitted on behalf of Khem Raj. I am not the original
author, nor do I claim any part of this work.)
--------------
Often gzip is reporting broken pipe errors with do_unpack of
tar.gz files.
If you use the commands described above to extract a tar.gz file, gzip
sometimes emits a Broken pipe error message. This can safely be ignored
if tar extracted all files without any other error message.
We do not let python install its SIGPIPE handler and use subprocess call
to invoke the command.
This is based on the following python bug report.
http://bugs.python.org/issue1652
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Koen Kooi <koen@openembedded.org>
-rw-r--r-- | classes/base.bbclass | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass index e622aeec51..69d1979be9 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -716,9 +716,14 @@ base_do_buildall() { : } +def subprocess_setup(): + import signal, subprocess + # Python installs a SIGPIPE handler by default. This is usually not what + # non-Python subprocesses expect. + signal.signal(signal.SIGPIPE, signal.SIG_DFL) def oe_unpack_file(file, data, url = None): - import bb, os + import bb, os, signal, subprocess if not url: url = "file://%s" % file dots = file.split(".") @@ -787,7 +792,7 @@ def oe_unpack_file(file, data, url = None): cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd) bb.note("Unpacking %s to %s/" % (base_path_out(file, data), base_path_out(os.getcwd(), data))) - ret = os.system(cmd) + ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True) os.chdir(save_cwd) |