]> code.ossystems Code Review - openembedded-core.git/commit
verify-bashisms: check scripts only once, include original file and line
authorPatrick Ohly <patrick.ohly@intel.com>
Tue, 31 Jan 2017 12:50:31 +0000 (13:50 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 31 Jan 2017 15:28:35 +0000 (15:28 +0000)
commitca4932b60f464430266cc43e34122b2973e8a200
tree797fbc1730392690fdaf7972975a2818fa32b1a3
parent32ae3e686db067a2a63932782970db79eb1703e8
verify-bashisms: check scripts only once, include original file and line

Several scripts that are defined in .bbclass files end up in multiple
different recipes. It's better (faster, less repetitive error reports)
to check them only once.

In addition, the real information for the developer is where he can
find the script, not which recipe file uses it. verify-bashisms now
prints the original file instead of the recipe whenever possible
(i.e. 'filename' is set) and also bumps the line number so that it is
relative to the file and not the script.

Example with one real error and one added just for testing:

  $ verify-bashisms core-image-minimal core-image-sato
  Loading cache: 100% |#################################################################################| Time: 0:00:00
  Loaded 2935 entries from dependency cache.
  Parsing recipes: 100% |###############################################################################| Time: 0:00:01
  Parsing of 2137 .bb files complete (2101 cached, 36 parsed). 2935 targets, 412 skipped, 0 masked, 0 errors.
  Generating scripts...
  Scanning scripts...

  /.../openembedded-core/meta/classes/populate_sdk_ext.bbclass
   possible bashism in install_tools line 515 (should be 'b = a'):
   if [ "${SDK_INCLUDE_TOOLCHAIN}" == "1" -a ! -e $unfsd_path ] ; then
   possible bashism in install_tools line 521 (type):
            type fixme

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/verify-bashisms