insane/package: refactor packaging sanity tests
authorRobert Yang <liezhi.yang@windriver.com>
Sat, 11 May 2013 22:46:10 +0000 (06:46 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Jun 2013 15:48:27 +0000 (16:48 +0100)
commitd80798ca6c43fa796742dea794db1c5fc539b72a
tree84fce563c3bc59ba8221ecc6eea418d11123c38a
parentdaa778a0b65259cfacf13bd985fc0ab09832f54d
insane/package: refactor packaging sanity tests

Refactor packaging sanity tests from package.bbclass to insane.bbclass
so that the message can respect WARN_QA (print the warning message and
go on the task) and ERROR_QA (print the error message and fail the
task).

- For the bb.warn(), give it a message name and add it to WARN_QA, then
  use package_qa_handle_error() to handle it.

- For the bb.error(), give it a message name and add it to ERROR_QA,
  then use package_qa_handle_error() to handle it.

- All the bb.warn() and bb.error() have been replaced in
  package.bbclass.

- A few bb.warn() and bb.error() in insane.bbclass have been kept since
  they can not be replaced or doesn't have to, for example the
  bb.error() in package_qa_check_license(), it will print the error
  message and then invoke bb.fatal() to fail the task, I think that we
  don't have to replace it with package_qa_handle_error().

- Put all the WARN_QA and ERROR_QA in one line, so that they can be
  redefined by the user easily.

[YOCTO #3190]
[YOCTO #4396]

(From OE-Core rev: 2f117ee615b703db07d3274ac592e2bd653743dd)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/insane.bbclass
meta/classes/package.bbclass