bitbake: bitbake-layers: add signal hander to avoid exception

Fixed:
bitbake-layers show-recipes | less
press "q" to exit

There will be a Broken pipe error output as follows:
"BrokenPipeError: [Errno 32] Broken pipe"

(Bitbake rev: 4fca9a07f2d6b0544977112672b786982d7bb8f2)

Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Zhixiong Chi 2017-04-12 11:29:17 +08:00 committed by Richard Purdie
parent 314df06b81
commit bcab5e12c1
1 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import logging
import os
import sys
import argparse
import signal
bindir = os.path.dirname(__file__)
topdir = os.path.dirname(bindir)
@ -35,6 +36,7 @@ import bb.msg
logger = bb.msg.logger_create('bitbake-layers', sys.stdout)
def main():
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
parser = argparse.ArgumentParser(
description="BitBake layers utility",
epilog="Use %(prog)s <subcommand> --help to get help on a specific command",