hob: The title of the packages screen depends on the screen you arrive from

- If you arrive to the packages screen from the recipes screen, the title
should say: 'Step 2 of 2: Edit packages'
- If you arrive to the packages screen from the image details screen, the
title should say: 'Edit packages'
- The title of the recipes screen should say 'Step 1 of 2: Edit recipes'

[YOCTO #2982]

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: don't show error dialog for errors during building

During building we already report errors in a special tab and
indicate when the build has failed; bringing up a dialog was a
regression introduced in bitbake revision
5bab81b124087d63d6eb62a861e1241714fcd483.

Fixes [YOCTO #3151].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: allow configuring default machine using HOB_MACHINE

Allow specifying HOB_MACHINE in local.conf to set the initially
selected machine. With this set, Hob will select the specified machine
and then jump straight into parsing recipes. If you do wish to change
the selected machine with HOB_MACHINE set you still can - you just need
to stop the parsing process first.

Fixes [YOCTO #3148].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: remove confirmation dialog on close

This is not necessary for modern applications - instead we just need to
check if we're in the middle of a build and if so, do the same thing as
pressing the "Stop" button.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: fix Gtk-WARNINGs due to invalid markup on Back button

You can't use markup characters (e.g '<' or '>') in the labels for many
widgets - you must use the appropriate entities instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/runqueue.py: fix exceptions with -k and failed targets

If a target dependency is marked as failed and yet we are continuing on
because -k has been specified, don't try to access the dependency's data
in taskData.build_targets since it will have been removed. This fixes
"IndexError: list index out of range" errors in this situation.

Also, do not print the "unhandled exception" message when SystemExit is
raised since we will have reported the actual error already in this
case (e.g. when -k has been specified and some targets failed).

Fixes [YOCTO #3133].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fetch2: make fetch failure errors more readable

Most of the time we don't need to see the fetch command; the fetch log
includes the command as a debug message in any case, so omit it. Also
adjust the way command output is printed (we don't need stderr/stdout
labelled, and print "no output" instead of "output:\nNone" when there is
no output.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fetch2: improve error output for checksum failures

* Don't print the full exception in the initial warning - if we later
  succeed in fetching the file from a mirror, we won't usually need the
  details (which are in the fetch log if they are needed); otherwise the
  full error will be printed when the fetch operation fails. Also adjust
  the conditional block so that we don't print another warning just
  mentioning we're going to try mirrors.
* Call logger.error() so that with knotty the full log is not printed
* Provide an explanation around the lines we print for easily updating
  the checksums in the recipe. We don't want users to be just blindly
  updating the recipe in case of a transient failure or deliberately
  altered remote file.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fetch2/git: Add missing mkdir

bitbake-selftest is failing due to directories not being created. This adds in an
appropriate mkdir so the tests can complete. Presumably in general OE use, something
else is ensuring the parent directory is created.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
runqueue: Add --no-setscene to skip all setscene tasks

Mainly intended for the purpose of debugging or forcing builds
from source, the --no-setscene will prevent any setscene
tasks from running.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
progress.py: Fix traceback when running goggle ui

The following traceback appears when running the following command after the
devshell is exited.

bitbake -u goggle -c devshell busybox

-- traceback --
Traceback (most recent call last):
  File "/work/bitbake/lib/bb/ui/goggle.py", line 35, in event_handle_idle_func
    build.handle_event (event, pbar)
  File "/work/bitbake/lib/bb/ui/crumbs/runningbuild.py", line 299, in handle_event
    pbar.set_text(event.msg)
AttributeError: 'ProgressBar' object has no attribute 'set_text'

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
event.py, knotty.py, ncurses.py, runningbuild.py: Add support for LogExecTTY event

The LogExecTTY even is intended to provide the ability to spawn a task
on a the controlling tty, if a tty is availble.  When a controlling
tty is not availble the previous behavior is preserved where a warning
is issued about the action an end user must execute.

All the available UI's were tested against the new event type.

This feature is primarily intended for hooking up a screen client
session automatically on the controlling tty to allow for a more
streamlined end user experience when using a pure command line driven
environment.  The changes that send the LogExecTTY event are in the
oe-core side.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake: Unbuffer stdout for log files

It is possible to lose critical log data when python exits in an
unorderly fashion via segmentation fault or certain types of crashes.
This is because the buffer characteristics are inherited from the top
level stdout, which should be set to unbuffered, for the purpose of
all the forked children.

This pushes the buffering to the OS, instead of having python managing
the buffers in its stream handler class.

This change is also to provide the ability to tail logs written from
processes in "real time" because they would be written in an orderly
fashion depending upon the OS characteristics for the file I/O.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>