fetch2: improve handling of two classes of URL parameter mistakes

Handle the following situations in a URL (e.g. in SRC_URI):

* Trailing semicolon in a URL - this is now ignored.
* Parameter specified with no value (no equals sign). This still
  produces an error, but at least it is MalformedUrl with a proper
  message rather than "ValueError: need more than 1 value to unpack".

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
utils: avoid printing traceback on ExpansionError during parsing

If an ExpansionError occurs during better_exec() we should just raise it
instead of printing the traceback, so that recipe errors (such as broken
URLs in SRC_URI) are more easily comprehensible.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
event: Fix event handlers to raise SkipPackage

If an event handler triggers a SkipPackage event, we really want that
event to be received and processed by the higher code levels. Currently
it was getting caught and ignored which was leading to recipes
being present when they clearly shouldn't have been.

In general this exception catching looks to be doing the wrong thing. It
was introduced in
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/bitbake/lib/bb/event.py?id=37cb4cc02b2e2b6c338c5943747e0a1ef15176b3
but we likely want exceptions to pass through to the higher layers.

This patch therefore removes that code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cookerdata: Improve error handling

If we see errors during parsing, firstly its bad to show a traceback
for an expansion error so lets suppress this.

Secondly, raise a BBHandledException instead of a SystemExit to show
we've informed the user about the condition (printing a traceback in the
default unknown case).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
event.py: Allow passthrough of BBHandledException events

We need BBHandledException events to be passed through to the higher
layers, they don't need addition of any traceback since they've already
been reported to the user.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
event: Add SkipRecipe event to replace SkipPackage

In the depths of time we were rather confused about naming. bb files
are recipes, the event to skip parsing them should be SkipRecipe,
not SkipPackage. This changes bitbake to use the better name but
leaves the other around for now. We can therefore start removing
references to it from the metadata.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
build/utils: Fix broken exception handling

Checking for explicit exception names is bad, we also want to be able top
rely on inheritance. Fix these checks to be part of the real except clauses
so SkipPackage is recognised as being inherited from SkipRecipe.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bb.fatal: Raise a BBHandledException instead of exiting

With new bitbake UIs having the cooker exit at 'random' points
in the codebase is problematic. This patch raises an exception
which matches the situation instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>