diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-01-13 17:01:48 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-15 10:06:21 +0000 |
commit | ecdfc1ebbe260fc7b2842b751d913580d294cb42 (patch) | |
tree | 6b5969f32ff057f580b39c537f85ae0fa930bd63 /bitbake/lib/bb | |
parent | 4e8085ccfa38f491edb7566a3d02795b8b5e6f73 (diff) | |
download | poky-ecdfc1ebbe260fc7b2842b751d913580d294cb42.tar.gz |
bitbake/fetch2: correctly decode exit signal/status
The termination signal and exit code of the fetch process were not being
decoded correctly, resulting in bitbake reporting that the process
terminated with a signal of the exit code (if it was under 255). There
are functions in the Python os module to do this decoding correctly (for
Unix at least), so let's use them.
(Bitbake rev: 50aea9a76e40cf71cc3f1462c88298e4846a031c)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 21abb13b19..771f72e4ae 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -422,8 +422,11 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []): | |||
422 | output += line | 422 | output += line |
423 | 423 | ||
424 | status = stdout_handle.close() or 0 | 424 | status = stdout_handle.close() or 0 |
425 | signal = status >> 8 | 425 | signal = os.WTERMSIG(status) |
426 | exitstatus = status & 0xff | 426 | if os.WIFEXITED(status): |
427 | exitstatus = os.WEXITSTATUS(status) | ||
428 | else: | ||
429 | exitstatus = 0 | ||
427 | 430 | ||
428 | if (signal or status != 0): | 431 | if (signal or status != 0): |
429 | for f in cleanup: | 432 | for f in cleanup: |
@@ -434,8 +437,8 @@ def runfetchcmd(cmd, d, quiet = False, cleanup = []): | |||
434 | 437 | ||
435 | if signal: | 438 | if signal: |
436 | raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output)) | 439 | raise FetchError("Fetch command %s failed with signal %s, output:\n%s" % (cmd, signal, output)) |
437 | elif status != 0: | 440 | elif exitstatus: |
438 | raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, status, output)) | 441 | raise FetchError("Fetch command %s failed with exit code %s, output:\n%s" % (cmd, exitstatus, output)) |
439 | 442 | ||
440 | return output | 443 | return output |
441 | 444 | ||