bitbake: Add --status-only option

The --status-only option is purely to check the health of the server.
The idea is to use it from the oe environment script so as to know if
the server needs to be started or not.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake, xmlrpc.py: Implement memory resident auto port configuration/restart

This patch adds the ability to dynamically select a port for the
bitbake memory resident server when the BBSERVER port is set to -1.
This allows for running multiple instances of the bitbake memory
resident server on the same system in different build directories.

The client portion of the bitbake instance can also request that the
server automatically start when using the auto port feature.  This is
to deal with a bitbake instance that eventually times out and exits or
that has died for some unknown reason.

The new functionality allows for lazy startup of the server after
sourcing the init script for the memory resident functionality.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake.lock: Add host:port to bitbake.lock for memres server

The idea is to build on the --status-only option for bitbake and
expose a mechanism where the oe init scripts can easily switch between
memres server and the non-memres server.

In the case of the standard oe init script the following
can shut down the server:

if [ -z "$BBSERVER" ] && [ -f bitbake.lock ] ; then
    grep ":" bitbake.lock > /dev/null && BBSERVER=`cat bitbake.lock` bitbake --status-only
    if [ $? = 0 ] ; then
       echo "Shutting down bitbake memory resident server with bitbake -m"
       BBSERVER=`cat bitbake.lock` bitbake -m
    fi
fi

A similar function can be used to automatically detect if the server
is already running for the oe memres init script.  This new
functionality allows for the memres init script to be started in a new
shell and connect up to an alaready running server without seeing the
error of trying to start the server multiple times.

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
imagedetailspage: Fix crash with more than 15 layers

If you had more than 15 layers the system would crash since one more
value is added to one array than the other. This fixes the code
so equal numbers of values are added to the arrays and hence
doesn't crash when many layers are enabled.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: fix rotating progress icon animation

I've always found it somewhat annoying that this icon's rotation
animation wasn't quite correct; this was because it was looping around
to the second position instead of the first, which made it appear to
stutter.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
codeparser/data_smart: Optimise parsing speed

The previous "contains" changes caused a ~3% parsing speed impact.
Looking at the cause of those changes was interesting:

* Use of defaultdict was slower than just checking for missing entries
  and setting them when needed.
* Even the "import collections" adversely affects parsing speed
* There was a missing intern function for the contains cache data
* Setting up a log object for each variable has noticeable overhead
  due to the changes in the code paths uses, we can avoid this.
* We can call getVarFlag on "_content" directly within VariableParse
  for a noticeable speed gain since its a seriously hot code path.

This patch therefore tweaks the code based on the above observations to
get some of the speed back.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: Use BASEDATASTORE_TRACKING feature

Might as well use this functionality now we have it available.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cooker/command/hob: Cleanup configuration init/reset functions and commands

initConfigurationData and loadConfigurationData are similar functions, the only
reason for them appears to be to be able to reset the pre/post configuration
files. The current code is confusing and unmaintainable.

Instead this patch creates a new Sync command which allows these to be explicitly
set. The init and load functions can then be merged into one. There is then no
need for a parseConfiguration command, we can simply reset the server to have the
settings take effect.

The reset fuction is not an instant value return and triggers an event so it should
be an Async command, not a sync one.

The number of calls for the set pre/post command is probably higher than it
need be but someone with more familiarity with the hob code base can probably
figure out the right places its needed (maybe just init_cooker?).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/ui: handle PKGSIZE change to bytes

PKGSIZE is now in bytes in pkgdata, so we need to treat it as such in
the UI code for Hob / Toaster.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: name package files list variables appropriately

This treeview code was obviously copy-pasted from one of the config
dialogs and the variables were never renamed. Rename them now to improve
readability.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: fix package property dialog for changes to FILES_INFO

The FILES_INFO structure is now much simpler, so remove all of the
horrible mangling we had to do here in order to read it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>