recipetool: make plugin registration function name consistent with devtool

This should have been register_commands rather than register_command;
I used register_commands in devtool so lets change this here to be
consistent with that. (Since this is extensible through layers though we
need to remain compatible with the old name, so fall back to that if the
new function name isn't there.)

(From OE-Core rev: 1047f6592ac81643cd847f104da766dc4a4c81ea)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton 2015-11-23 08:55:45 +13:00 committed by Richard Purdie
parent b381f804a5
commit 0cc3810299
5 changed files with 9 additions and 5 deletions

View File

@ -435,7 +435,7 @@ def target_path(targetpath):
return targetpath
def register_command(subparsers):
def register_commands(subparsers):
common = argparse.ArgumentParser(add_help=False)
common.add_argument('-m', '--machine', help='Make bbappend changes specific to a machine only', metavar='MACHINE')
common.add_argument('-w', '--wildcard-version', help='Use wildcard to make the bbappend apply to any recipe version', action='store_true')

View File

@ -436,7 +436,7 @@ def convert_debian(debpath):
return values
def register_command(subparsers):
def register_commands(subparsers):
parser_create = subparsers.add_parser('create',
help='Create a new recipe',
description='Creates a new recipe from a source tree')

View File

@ -97,7 +97,7 @@ def newappend(args):
print(append_path)
def register_command(subparsers):
def register_commands(subparsers):
parser = subparsers.add_parser('newappend',
help='Create a bbappend for the specified target in the specified layer')
parser.add_argument('-w', '--wildcard-version', help='Use wildcard to make the bbappend apply to any recipe version', action='store_true')

View File

@ -62,7 +62,7 @@ def setvar(args):
return 0
def register_command(subparsers):
def register_commands(subparsers):
parser_setvar = subparsers.add_parser('setvar',
help='Set a variable within a recipe',
description='Adds/updates the value a variable is set to in a recipe')

View File

@ -82,7 +82,11 @@ def main():
registered = False
for plugin in plugins:
if hasattr(plugin, 'register_command'):
if hasattr(plugin, 'register_commands'):
registered = True
plugin.register_commands(subparsers)
elif hasattr(plugin, 'register_command'):
# Legacy function name
registered = True
plugin.register_command(subparsers)
if hasattr(plugin, 'tinfoil_init'):