]> code.ossystems Code Review - openembedded-core.git/commitdiff
recipetool: make plugin registration function name consistent with devtool
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Sun, 22 Nov 2015 19:55:45 +0000 (08:55 +1300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 1 Dec 2015 21:30:55 +0000 (21:30 +0000)
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.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/recipetool/append.py
scripts/lib/recipetool/create.py
scripts/lib/recipetool/newappend.py
scripts/lib/recipetool/setvar.py
scripts/recipetool

index 867d55a23b3a1eaac2bf65c0f309f6a9a6eb90f9..558fd25ac5648f9123cd43b00068100d51afd50f 100644 (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')
index 15aa9bdbb36a2dc92d443682e800e3c25f0012c7..2d750465d12ce9c62ce2e6d46fbe5e6c7460ab09 100644 (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')
index 4eeac0e943bf712afb205257dab8e16caeaa9c86..f9b8d85ecf90602ba4ea170883ac6bb281caf7a6 100644 (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')
index 18e3281b0e2054fd3bb3e43d7a98f24443f787b9..657d2b6a7b10d6f6f14c2dd235477f7ca6996450 100644 (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')
index 4af0bfb686edc70a059dfe9ca907d31964131cd0..791a66aaca9e720d4dbbbf48392b1e3a1ff5b5f0 100755 (executable)
@@ -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'):