bitbake: BBHandler/ConfHandler: Improve multiline comment handling

Faced with an expression like:

 # Some comment \
 FOO = "bar"

what should bitbake do? Technically, the \ character means its multiline and
currently the code treats this as a continuation of the comment. This can
surprise some people and is not intuitive.

This patch makes bitbake simply error and asks the user to be clearer
about what they mean.

(Bitbake rev: 589d31ce41e019ee6a7cb6527d67bc76c0b6382a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
BBHandler/ConfHandler: Merge fix for multiline comments

This was meant to be squashed into the previous commit for multiline comment
handling. It fixes the case the commented multiline is followed by an empty
line which was resulting in a traceback instead of a sane error message.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: progress bar changed to busy cursor when you open log file

-the first implementation for this bug used a progress bar, that is shown
during open file process; it revelead that the progress bar stops earlier
-now I have implemented using gtk.show_uri() method, that shows itself a
busy cursor when it opens a file;
-deleted the code for the first implementation

[YOCTO #2997]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: Hob should display warnings generated during parsing

-now Hob catches the warnings generated during parsing, and after the parsing
is completed, if there are any warnings, it shows a bar that contains a message
with how many warnings has encountered, and a button "View warnings"
-when "View warnings" button is clicked, Hob shows a dialog with the warnings;
if there more than 1 warning, you can use "Previous" and "Next" button to see them

[YOCTO #3215]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
parse_py: add ~ to config_regexp

- enable the '~' character in bitbake variables

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
persist_data: add get_by_pattern method to API

- one can use get_by_pattern to get a list of values associated
with keys that match the specified pattern

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: combo box updated correctly

The 'select a base image' option is no longer displayed once
an image is selected

[YOCTO #3671]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
crumbs: Add file lost from previous commit

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
prserv: use only PRSERV_HOST

- remove PRSERV_PORT variable
- use 'hostname:port' as PRSERV_HOST format
- use 'localhost:0' for enabling the local PRServer

[YOCTO #3744]

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: hob do not use .hob dir for variables from local.conf and bblayers.conf

If .hob exists, hob takes the variable from there. Change to not override anymore
the variables which comes from bblayers.conf and local.conf

[YOCTO #2934]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cache.py: remove the duplicated self.file_depends

There are two "self.file_depends =" lines in cache.py::CoreRecipeInfo:

class CoreRecipeInfo(RecipeInfoCommon):
    __slots__ = ()

    cachefile = "bb_cache.dat"

    def __init__(self, filename, metadata):
        self.file_depends = metadata.getVar('__depends', False)
    [snip]
        self.file_depends = metadata.getVar('__depends', False)

They are duplicated, remove the last one.

[YOCTO #3795]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake-layers: fix get_file_layer

The get_file_layer can't handle the nested layer correctly, e.g.:

meta-intel/conf/layer.conf
meta-intel/meta-cedartrail/conf/layer.conf

They are two layers, the file:
meta-intel/common/recipes-bsp/amt/lms_7.1.20.bb
belongs to meta-intel's layer, but the get_file_layer() may return
meta-cedartrail accordig to BBLAYERS' order, since it uses:

for layerdir in self.bblayers:
    if regex.match(os.path.join(layerdir, 'test')):
        return self.get_layer_name(layerdir)

which doesn't care the filename, re-match the filename would fix the
problem.

[YOCTO #3387]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake-diffigs: Don't pull in tinfoil unless we really need/plan to use it

This means we can run in parallel with other bitbake processed we're not in
task mode.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
utils.py: Add function for processing profile output

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
build.py: Dump out performance data of individual tasks

Signed-off-by: Richard  Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cache.py: Drop support for BROKEN variable

All it now does is function in a similar way to EXCLUDE_FROM_WORLD and
since we have a better named variable for this, lets just drop the
usage of BROKEN at the bitbake level.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake & hob: implement functions to assure consistency for configuration files

Added a new command in bitbake to save a variable in a file; added a function
in cooker which is called by this command.

Added new command in bitbake to enable/disable data tracking.

The function saveConfigurationVar from cooker.py saves a variable in the file that
is received by argument. It checks all the operations made on that variable, using the history.
If it's the first time when it does some changes on a variable,it comments the lines where
an operation is made on it, and it sets it in a line to the end of file. If it's not
the first time(it has a comment before), it replaces the line.

Made some changes in hob to save the variables from bblayers.conf and local.conf
using the bitbake command.

[YOCTO #2934]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: small fixes to parsing warnings dialog

Set the labels selectable; reset the warnings list when another machine is selected;
changed a label name

[YOCTO #3215]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
tinfoil: support other fds, enable color support

Rather than only handling sys.stdout, also support any arbitrary file object,
and enable color for the formatter if that file is a tty.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
hob: Use a GtkTreeView to present and configure the sstate mirrors

After some discussions about the design of the Shared State Settings tab in Hob,
we have decided that using a GtkTreeView to present and configure the sstate
mirrors is probably the best solution.

[YOCTO #3569]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>