Commit Graph

10 Commits

Author SHA1 Message Date
Paul Eggleton 8e0a84c901 scripts: print usage in argparse-using scripts when a command-line error occurs
For scripts that use Python's standard argparse module to parse
command-line arguments, create a subclass which will show the usage
the usage information when a command-line parsing error occurs. The most
common case would be when the script is run with no arguments; at least
then the user immediately gets to see what arguments they might need to
pass instead of just an error message.

(From OE-Core rev: d62fe7c9bc2df6a4464440a3cae0539074bf99aa)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-28 09:25:12 +00:00
Paul Eggleton 0cc3810299 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>
2015-12-01 21:32:05 +00:00
Paul Eggleton b381f804a5 recipetool: add setvar subcommand
Add a recipetool subcommand "setvar" to set a variable in a file. This
uses our existing logic such that it doesn't matter if the variable is
already set in the recipe, if it's set in the recipe or some inc file,
and if the variable is not currently set that the line setting the
variable gets inserted in the right place in the file.

Implements [YOCTO #7676].

(From OE-Core rev: 7c33ef77fa165182d24f0a9ae769e9e630e6bd47)

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>
2015-12-01 21:32:05 +00:00
Christopher Larson da02f483c4 recipetool: parse global args early
This separates the argument parsing into two steps, which lets us apply global
settings like enabling debugging before the plugins load, so we can see the
paths where plugins are being loaded.

(From OE-Core rev: 899288a1b255052a6ee0f97d42f8c4f0ec3c3140)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson 71366782d9 recipetool: also load plugins from BBPATH
This makes it easier to extend, as a layer can add its own sub-commands.

The bitbake path setup is moved earlier, as it has to be done before
tinfoil_init.

[YOCTO #7625]

(From OE-Core rev: 5753f20acc31d4d8d93069e3daccce1fad27b7ac)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:12 +01:00
Christopher Larson e28c4ba7bf recipetool: catch BBHandledException from parsing
This ensures that we don't see a traceback on parsing failures.

(From OE-Core rev: 22ba003f62a321c3b8405a03d6c9ee04dc0a62a6)

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:12 +01:00
Paul Eggleton fbfc06a969 recipetool: add appendfile subcommand
Locating which recipe provides a file in an image that you want to
modify and then figuring out how to bbappend the recipe in order to
replace it can be a tedious process. Thus, add a new appendfile
subcommand to recipetool, providing the ability to create a bbappend
file to add/replace any file in the target system. Without the -r
option, it will search for the recipe packaging the specified file
(using pkgdata from previously built recipes). The bbappend will be
created at the appropriate path within the specified layer directory
(which may or may not be in your bblayers.conf) or if one already exists
it will be updated appropriately.

Fairly extensive oe-selftest tests are also provided.

Implements [YOCTO #6447].

(From OE-Core rev: dd2aa93b3c13d2c6464ef0fda59620c7dba450bb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Paul Eggleton 3d0418a331 devtool / recipetool: ensure bb.note() gets printed
Most of the time when bb.note() gets called we want to see the output,
so ensure the level is set appropriately depending on the command line
options instead of being fixed at warning. (We don't want to see the
notes for fetch/unpack/patch though as they are too verbose).

(From OE-Core rev: 69f426a2d966a2228cbdc708b9ddab31005c6d96)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:03 +01:00
Paul Eggleton a3dfb70b62 recipetool: improve command-line help
Based on feedback from Scott Rifenbark <scott.m.rifenbark@intel.com>

(From OE-Core rev: 2c59b2b20c32577085645056e4cbf4f9c259e4d7)

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>
2015-02-08 08:00:27 +00:00
Paul Eggleton 5638ca2b94 scripts/recipetool: Add a recipe auto-creation script
Add a more maintainable and flexible script for creating at least the
skeleton of a recipe based on an examination of the source tree.
Commands can be added and the creation process can be extended through
plugins.

[YOCTO #6406]

(From OE-Core rev: fa07ada1cd0750f9aa6bcc31f8236205edf6b4ed)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-23 10:18:15 +00:00