From d43d3b007eac502c9c1ba8f5ff5cc8f984c84ddf Mon Sep 17 00:00:00 2001 From: Jason Wessel Date: Wed, 13 Jun 2012 22:09:38 -0500 Subject: fetch2: Fix missing output from stderr in fetcher logs There are actually two problems to fix 1) The exception for bb.process.ExecutionError must be processed first because it is a derived from the bb.process.CmdError class and we never reach the ExecutionError otherwise. 2) The stderr needs to be printed as well as stdout to determine the root cause of a fetch failure. The example I have is that I got a log that looked like: -- ERROR: Function failed: Network access disabled through BB_NO_NETWORK but access requested with command /usr/bin/env wget -t 5 -nv --passive-ftp --no-check-certificate -P /localds 'http://downloads.yoctoproject.org/[...CLIPPED...] url None) -- That really didn't tell me much, but with this patch I get error above plus the following: -- STDERR: /net/[...CLIPPED...]kernel-tools.git: Read-only file system -- (Bitbake rev: af2133a04e1f4b22b181adf9c71f89c439bb88cf) Signed-off-by: Jason Wessel Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 83050e4c1f..324eef28a7 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -437,11 +437,10 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []): success = True except bb.process.NotFoundError as e: error_message = "Fetch command %s" % (e.command) + except bb.process.ExecutionError as e: + error_message = "Fetch command %s failed with exit code %s, output:\nSTDOUT: %s\nSTDERR: %s" % (e.command, e.exitcode, e.stdout, e.stderr) except bb.process.CmdError as e: error_message = "Fetch command %s could not be run:\n%s" % (e.command, e.msg) - except bb.process.ExecutionError as e: - error_message = "Fetch command %s failed with exit code %s, output:\n%s" % (e.command, e.exitcode, e.stderr) - if not success: for f in cleanup: try: -- cgit v1.2.3-54-g00ecf