diff options
Diffstat (limited to 'bitbake/bin/bitbake-layers')
-rwxr-xr-x | bitbake/bin/bitbake-layers | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers index ff085d6744..aebb5100c2 100755 --- a/bitbake/bin/bitbake-layers +++ b/bitbake/bin/bitbake-layers | |||
@@ -14,6 +14,8 @@ import logging | |||
14 | import os | 14 | import os |
15 | import sys | 15 | import sys |
16 | import argparse | 16 | import argparse |
17 | import warnings | ||
18 | warnings.simplefilter("default") | ||
17 | 19 | ||
18 | bindir = os.path.dirname(__file__) | 20 | bindir = os.path.dirname(__file__) |
19 | topdir = os.path.dirname(bindir) | 21 | topdir = os.path.dirname(bindir) |
@@ -31,7 +33,7 @@ def main(): | |||
31 | add_help=False) | 33 | add_help=False) |
32 | parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') | 34 | parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') |
33 | parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') | 35 | parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') |
34 | parser.add_argument('-F', '--force', help='Force add without recipe parse verification', action='store_true') | 36 | 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) |
35 | parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR') | 37 | parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR') |
36 | 38 | ||
37 | global_args, unparsed_args = parser.parse_known_args() | 39 | global_args, unparsed_args = parser.parse_known_args() |
@@ -57,20 +59,24 @@ def main(): | |||
57 | plugins = [] | 59 | plugins = [] |
58 | tinfoil = bb.tinfoil.Tinfoil(tracking=True) | 60 | tinfoil = bb.tinfoil.Tinfoil(tracking=True) |
59 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) | 61 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) |
60 | try: | 62 | if global_args.force > 1: |
63 | bbpaths = [] | ||
64 | else: | ||
61 | tinfoil.prepare(True) | 65 | tinfoil.prepare(True) |
62 | for path in ([topdir] + | 66 | bbpaths = tinfoil.config_data.getVar('BBPATH').split(':') |
63 | tinfoil.config_data.getVar('BBPATH').split(':')): | 67 | |
68 | try: | ||
69 | for path in ([topdir] + bbpaths): | ||
64 | pluginpath = os.path.join(path, 'lib', 'bblayers') | 70 | pluginpath = os.path.join(path, 'lib', 'bblayers') |
65 | bb.utils.load_plugins(logger, plugins, pluginpath) | 71 | bb.utils.load_plugins(logger, plugins, pluginpath) |
66 | 72 | ||
67 | registered = False | 73 | registered = False |
68 | for plugin in plugins: | 74 | for plugin in plugins: |
75 | if hasattr(plugin, 'tinfoil_init') and global_args.force <= 1: | ||
76 | plugin.tinfoil_init(tinfoil) | ||
69 | if hasattr(plugin, 'register_commands'): | 77 | if hasattr(plugin, 'register_commands'): |
70 | registered = True | 78 | registered = True |
71 | plugin.register_commands(subparsers) | 79 | plugin.register_commands(subparsers) |
72 | if hasattr(plugin, 'tinfoil_init'): | ||
73 | plugin.tinfoil_init(tinfoil) | ||
74 | 80 | ||
75 | if not registered: | 81 | if not registered: |
76 | logger.error("No commands registered - missing plugins?") | 82 | logger.error("No commands registered - missing plugins?") |