diff options
Diffstat (limited to 'bitbake/bin/bitbake-layers')
-rwxr-xr-x | bitbake/bin/bitbake-layers | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers index a884dc1f8d..aebb5100c2 100755 --- a/bitbake/bin/bitbake-layers +++ b/bitbake/bin/bitbake-layers @@ -14,7 +14,8 @@ import logging import os import sys import argparse -import signal +import warnings +warnings.simplefilter("default") bindir = os.path.dirname(__file__) topdir = os.path.dirname(bindir) @@ -26,14 +27,13 @@ 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", add_help=False) parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') - parser.add_argument('-F', '--force', help='Force add without recipe parse verification', action='store_true') + parser.add_argument('-F', '--force', help='Forced execution: can be specified multiple times. -F will force add without recipe parse verification and -FF will additionally force the run withput layer parsing.', action='count', default=0) parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR') global_args, unparsed_args = parser.parse_known_args() @@ -52,25 +52,31 @@ def main(): # Need to re-run logger_create with color argument # (will be the same logger since it has the same name) - bb.msg.logger_create('bitbake-layers', output=sys.stdout, color=global_args.color) + bb.msg.logger_create('bitbake-layers', output=sys.stdout, + color=global_args.color, + level=logger.getEffectiveLevel()) plugins = [] tinfoil = bb.tinfoil.Tinfoil(tracking=True) tinfoil.logger.setLevel(logger.getEffectiveLevel()) - try: + if global_args.force > 1: + bbpaths = [] + else: tinfoil.prepare(True) - for path in ([topdir] + - tinfoil.config_data.getVar('BBPATH').split(':')): + bbpaths = tinfoil.config_data.getVar('BBPATH').split(':') + + try: + for path in ([topdir] + bbpaths): pluginpath = os.path.join(path, 'lib', 'bblayers') bb.utils.load_plugins(logger, plugins, pluginpath) registered = False for plugin in plugins: + if hasattr(plugin, 'tinfoil_init') and global_args.force <= 1: + plugin.tinfoil_init(tinfoil) if hasattr(plugin, 'register_commands'): registered = True plugin.register_commands(subparsers) - if hasattr(plugin, 'tinfoil_init'): - plugin.tinfoil_init(tinfoil) if not registered: logger.error("No commands registered - missing plugins?") |