]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
9 years agotoaster: handle multiple imagefs types
Sujith H [Thu, 19 May 2016 10:43:30 +0000 (11:43 +0100)] 
toaster: handle multiple imagefs types

This functionality helps users to add custom
image fs types available other than the checkboxes
in the UI. User can add imagefs types in the text
box and use them in the build.

[YOCTO #7828]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Improve taskgraph file handling
Richard Purdie [Thu, 19 May 2016 14:16:11 +0000 (15:16 +0100)] 
cooker: Improve taskgraph file handling

Use open() instead of file() and close files when finished with them.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocodeparser: Increase cache version after code parser dependency changes
Richard Purdie [Wed, 18 May 2016 22:20:42 +0000 (23:20 +0100)] 
codeparser: Increase cache version after code parser dependency changes

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.codeparser: track variable flag references
Christopher Larson [Sat, 30 Apr 2016 19:52:45 +0000 (12:52 -0700)] 
bb.codeparser: track variable flag references

Previously we only tracked the flags (minus excluded) of variables we depend
on, but not the flags we use explicitly.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoProvide LAYERDIR_RE for layer.conf
Christopher Larson [Sat, 30 Apr 2016 19:52:49 +0000 (12:52 -0700)] 
Provide LAYERDIR_RE for layer.conf

This variable is a regex-escaped version of LAYERDIR, for safer use in
BBFILE_PATTERN, so as to avoid issues with regex special characters in the
layer path.

[YOCTO #8402]

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocache: Increase cache version after task checksum calculation changes
Richard Purdie [Wed, 18 May 2016 22:20:21 +0000 (23:20 +0100)] 
cache: Increase cache version after task checksum calculation changes

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoImplement support for per-task exports
Christopher Larson [Sat, 30 Apr 2016 19:52:48 +0000 (12:52 -0700)] 
Implement support for per-task exports

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.cooker: show limited traceback for parsing ExpansionError
Christopher Larson [Sat, 30 Apr 2016 19:52:46 +0000 (12:52 -0700)] 
bb.cooker: show limited traceback for parsing ExpansionError

It's useful to see tracebacks for ExpansionErrors, but only if we skip the
leading bitbake-internal elements, otherwise we see elements of the expansion
process.

As one example:

Before:

    ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external'

After:

    ERROR: ExpansionError during parsing /scratch/yocto-new/external-as-needed/poky/meta/recipes-core/glibc/glibc-locale_2.23.bb
    Traceback (most recent call last):
      File "PV[:=]", line 1, in <module>
      File "/scratch/yocto-new/external-as-needed/meta-sourcery/recipes-external/glibc/glibc-external-version.inc", line 3, in get_external_libc_version(d=<bb.data_smart.DataSmart
    object at 0x7f05d2566950>):
             sopattern = os.path.join(d.getVar('base_libdir', True), 'libc-*.so')
        >    found_paths = oe.external.find_sysroot_files([sopattern], d)
             if found_paths:
    ExpansionError: Failure expanding variable PV[:=], expression was ${@get_external_libc_version(d)} which triggered exception AttributeError: 'module' object has no attribute 'external'

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-layers: convert to plugin-based
Christopher Larson [Sat, 30 Apr 2016 19:41:00 +0000 (12:41 -0700)] 
bitbake-layers: convert to plugin-based

This uses bb.utils.load_plugins, based on the plugin handling in recipetool
and devtool in oe-core.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Fix output buffering issues
Richard Purdie [Mon, 16 May 2016 21:52:00 +0000 (22:52 +0100)] 
knotty: Fix output buffering issues

We need to flush the footer removal, else it may not be outputted until
the buffer is flushed as part of StreamHandler and this would lead to
it removing the ERROR output just printed which is extremely confusing.

Also ensure the footer is cleared before printing a summary as in
some cases it wasn't being removed, also leading to user confusion.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agosiggen: Fixes to handle sigdata/siginfo files only containing basehash data
Richard Purdie [Mon, 16 May 2016 21:51:08 +0000 (22:51 +0100)] 
siggen: Fixes to handle sigdata/siginfo files only containing basehash data

The signature data file comparison functions are meant to be able to
handle data files containing just the base hash data. This had regressed
in some places so add fixes to allow these comparisons to be made. The
runtime components in the data files are optional.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: don't show "Rebuild" button for cancelled cli builds
Elliot Smith [Thu, 12 May 2016 14:10:38 +0000 (15:10 +0100)] 
toaster: don't show "Rebuild" button for cancelled cli builds

[YOCTO #8515]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoasterui: capture keyboard interrupts the same way as knotty
Elliot Smith [Thu, 12 May 2016 14:10:37 +0000 (15:10 +0100)] 
toasterui: capture keyboard interrupts the same way as knotty

knotty captures two levels of keyboard interrupt: a single interrupt
or two interrupts in a row. These then trigger stateShutdown
and stateForceShutdown respectively.

toasterui doesn't have an equivalent way of capturing interrupts and
using them to shut down bitbake. Now that we are no longer using
knotty + XMLRPCServer for our command line builds (since switching to
per-project build directories), we see some odd side effects of this,
such as builds continuing after they have been interrupted on the
command line.

Bring toasterui in line with knotty (copy-paste most of the code
in knotty.py which deals with interrupts) so that a keyboard
interrupt actually shuts down the bitbake server (if not in
observe only mode).

Additionally use the cancel_cli_build() method to set the Build
status to CANCELLED in Toaster's db when we get keyboard interrupts.
This means that builds interrupted on the command line show as
cancelled (same as if they'd been cancelled from the Toaster UI),
as specified in the UI designs.

[YOCTO #8515]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuildinfohelper: add method to set current build as CANCELLED
Elliot Smith [Thu, 12 May 2016 14:10:36 +0000 (15:10 +0100)] 
buildinfohelper: add method to set current build as CANCELLED

This will be used from toasterui to cancel the current command-line
build when a keyboard interrupt is captured.

[YOCTO #8515]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: toastergui tests Fix toastertable tests
Michael Wood [Mon, 16 May 2016 13:50:41 +0000 (14:50 +0100)] 
toaster: toastergui tests Fix toastertable tests

After clean ups remove api assumptions. Our table data often contains
html snippets to display certain things such as dependency pop overs or
simply links to other parts of the UI. Take these into account when
testing the values of the table data.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: toastertables: Clean up and fix up a number of items
Michael Wood [Mon, 16 May 2016 13:50:40 +0000 (14:50 +0100)] 
toaster: toastertables: Clean up and fix up a number of items

 - Remove the unused 'computation' field
 - Remove the code to try to make the tables behave like an api
 - Remove custom JSON encoder in favour of DjangoJSONEncoder
 - Simplify get_data and add comments
 - Add exception type instead of using generic Exception
 - Clean up python style warnings

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use new syntax of except statement
Ed Bartosh [Tue, 10 May 2016 14:10:30 +0000 (17:10 +0300)] 
toaster: use new syntax of except statement

Used except 'except (<exception1>, <exception2>):' syntax as it's
supported by python 2 and pythone 3.

Old syntax 'except <exception1>, <exception2>:' is not supported
by python 3.

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use print function in toaster script
Ed Bartosh [Tue, 10 May 2016 08:31:14 +0000 (11:31 +0300)] 
toaster: use print function in toaster script

Used print() function instead of print statement
to make toaster script to work with both python 2 and python 3

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use 'in' instead of has_key
Ed Bartosh [Tue, 10 May 2016 13:27:19 +0000 (16:27 +0300)] 
toaster: use 'in' instead of has_key

Dictionary method has_key is deprecated in python 2 and absent
in python 3.

Used '<key> in <dict>' statement to make the code working on
both python 2 and python 3.

[YOCTO #9584]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoserver/process: Fix missing log messages issue
Richard Purdie [Thu, 12 May 2016 22:27:25 +0000 (23:27 +0100)] 
server/process: Fix missing log messages issue

Currently if the server dies, its possible that log messages are never
displayed which is particularly problematic if one of those messages
is the exception and backtrace the server died with.

Rather than having the event queue exit as soon as the server disappears,
we should pop events from the queue until its empty before exiting.

This patch tweaks that code so that even if the server is dead and we're
going to exit, we return any events left in the pipe. This makes
debugging certain failures much easier.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker/toasterui: Drop SEND_DEPENDS_TREE UI feature
Richard Purdie [Fri, 13 May 2016 13:02:56 +0000 (14:02 +0100)] 
cooker/toasterui: Drop SEND_DEPENDS_TREE UI feature

Now the event is sent unconditionally we can drop this feature
as its no longer needed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue.py: always emit bb.event.DepTreeGenerated
Patrick Ohly [Thu, 12 May 2016 15:00:10 +0000 (17:00 +0200)] 
runqueue.py: always emit bb.event.DepTreeGenerated

The data included in the event is useful for implementing a pre-build
check that warns about unexpected components, for example because of
an incorrect configuration or changed dependencies.

Such a check can be done in a .bbclass that gets inherited
globally. But in contrast to a UI, such a class cannot request that
the event shall be emitted, and thus the event has to be emitted
whether there is a consumer or not.

This was done conditionally earlier out of concerns about the
performance impact. But now events are handled more efficiently, so
that concern no longer seems valid: in some simple testing (admittedly
on a fast build workstation), the two lines (generating the data and
emitting the event with it) only took about 0.05 seconds (measured
with timeit). That was for a build with roughly 500 recipes (from
pn-buildlist aka depgraph['pn']), triggered via the command line. That
was even with a consumer of the data active and doing some work, so it
should be even faster when there is no consumer.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fix progress bar in MySQL environment
Elliot Smith [Fri, 13 May 2016 16:02:58 +0000 (17:02 +0100)] 
toaster: fix progress bar in MySQL environment

When using MySQL, the project builds info delivered by MySQL
differs from that delivered by SQLite: the former returns text
values from the enumeration for Build outcomes, while the latter
returns the integer value. This causes the progress bar JS to
break, as it is expecting outcome strings.

Modify the recent_build() method to include an outcomeText property
for each Build object, then use this in the conditionals in the
progress bar JS.

[YOCTO #9498]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agomain: Ensure exceptions are correctly displayed
Richard Purdie [Thu, 12 May 2016 07:15:34 +0000 (08:15 +0100)] 
main: Ensure exceptions are correctly displayed

If the cooker fails to start, ensure a correct exception is displayed to the
user. After handling any queued events simply re-raise the original exception
else the output can be unclear.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocookerdata: Fix log messages and ensure we exit
Richard Purdie [Thu, 12 May 2016 07:13:04 +0000 (08:13 +0100)] 
cookerdata: Fix log messages and ensure we exit

The string formatting wasn't correct and we should exit if we hit
errors here similar to the other exception handlers.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoevent/msg: Pass formatted exceptions
Richard Purdie [Thu, 12 May 2016 07:05:32 +0000 (08:05 +0100)] 
event/msg: Pass formatted exceptions

python3 can't cope with the previous approach we were using to pass
exceptions through the RPC. Avoid this by creating a formatted exception
on the sender side.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch: Use OrderedDict for url parameters
Richard Purdie [Thu, 12 May 2016 07:04:17 +0000 (08:04 +0100)] 
fetch: Use OrderedDict for url parameters

Without this, the dict can reorder causing sanity test failures.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agomain: Change warn() -> warning()
Richard Purdie [Thu, 12 May 2016 07:02:45 +0000 (08:02 +0100)] 
main: Change warn() -> warning()

This avoids a deprecation warning in python 3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Fix log message syntax
Richard Purdie [Thu, 12 May 2016 07:01:23 +0000 (08:01 +0100)] 
cooker: Fix log message syntax

Ensure we pass the string parameter correctly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoutils: Force bitbake to en_US.UTF-8 locale setting everywhere
Richard Purdie [Wed, 11 May 2016 22:00:15 +0000 (23:00 +0100)] 
utils: Force bitbake to en_US.UTF-8 locale setting everywhere

Under python 3, if we spawn python processes, we need to have a UTF-8
locale, else python's file access methods will use ascii. You can't
change that mode once the interpreter is started so we have to ensure
a locale is set. Ideally we'd use C.UTF-8 since OE already forces the
C locale but not all distros support that and we need to set something.
Was tempted to choose en_GB so colour gets spelt correctly :).

This is in some ways pretty nasty, forcing it into the environment
everywhere however we only have a limited number of ways of making
everything work correctly and this beats having to add utf-8 encoding
to every file access command.

A similar change will be needed to bitbake.conf in OE.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobin/bitbake-worker: Fix invalid bb.msg.fatal usage
Richard Purdie [Wed, 11 May 2016 21:57:10 +0000 (22:57 +0100)] 
bin/bitbake-worker: Fix invalid bb.msg.fatal usage

The logging domain specified to bb.msg.fatal was invalid. Replace with
a logger.critical() call instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocontrib/dump_cache.py, cache: Fix to use python 3 syntax
Richard Purdie [Wed, 11 May 2016 21:56:29 +0000 (22:56 +0100)] 
contrib/dump_cache.py, cache: Fix to use python 3 syntax

Some tweaks to use python 3 syntax in a python 2 compatible way.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Ensure consolelog file handle is closed
Richard Purdie [Wed, 11 May 2016 21:55:53 +0000 (22:55 +0100)] 
knotty: Ensure consolelog file handle is closed

If we don't close the console log file handle, python prints a warning
about unclosed file handles upon exit which is annoying.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Improve timestamp comparisons
Richard Purdie [Wed, 11 May 2016 21:55:14 +0000 (22:55 +0100)] 
runqueue: Improve timestamp comparisons

python3 cares more about invalid type comparisons. Add break statements
and better tests to make the code paths clearer and avoid type issues
in python3. No code functionality change.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodaemonize/prserv/tests/fetch: Convert file() -> open()
Richard Purdie [Wed, 11 May 2016 21:54:22 +0000 (22:54 +0100)] 
daemonize/prserv/tests/fetch: Convert file() -> open()

Use python3 compatible functions.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests browser Add test for creating a project
Michael Wood [Mon, 9 May 2016 23:01:52 +0000 (00:01 +0100)] 
toaster: tests browser Add test for creating a project

Add browser tests for creating a project and test validation of
duplicate project names.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: models Add missing import sys
Michael Wood [Mon, 9 May 2016 23:01:51 +0000 (00:01 +0100)] 
toaster: models Add missing import sys

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: ui handles duplicate project name in project page
Sujith H [Mon, 9 May 2016 23:01:50 +0000 (00:01 +0100)] 
toaster: ui handles duplicate project name in project page

When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name. When an existing project is typed the save
button will be disabled. Else user can proceed ahead by
modifying the project name.

[YOCTO #7005]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: ui handles duplicate project name in new project page
Sujith H [Mon, 9 May 2016 23:01:49 +0000 (00:01 +0100)] 
toaster: ui handles duplicate project name in new project page

When already existing project name is typed by user,
the ui pops up message regarding the existance of the
project name.

[YOCTO #7005]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: projectNameValidation API added
Sujith H [Mon, 9 May 2016 23:01:48 +0000 (00:01 +0100)] 
toaster: projectNameValidation API added

The projectNameValidation API would help users
to validate if a project name exists or not. This
API is added to libtoaster.

[YOCTO #7005]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Fix missing fakeworker under dry run
Richard Purdie [Mon, 9 May 2016 13:15:26 +0000 (14:15 +0100)] 
runqueue: Fix missing fakeworker under dry run

We shouldn't try and use fakeworker when performing a dry_run. This
makes the core match the other fakeworker execution points.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils.py: Fix explode_dep_versions2() determinism issue
Richard Purdie [Mon, 9 May 2016 13:07:17 +0000 (14:07 +0100)] 
lib/bb/utils.py: Fix explode_dep_versions2() determinism issue

When we pass data into explode_dep_versions2(), we need to result to be
able to be processed in a deterministic way so that we end up with
consistent hash values. This means we need an ordered structure rather
than an unordered one.

To do this, return an OrderedDict() rather than a dict().

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobin, toaster: Fix print and exception syntax
Richard Purdie [Mon, 9 May 2016 13:05:09 +0000 (14:05 +0100)] 
bin, toaster: Fix print and exception syntax

This updates the print "" syntax to print() and fixes some exception
handling syntax such that its compatible with python v2 and v3.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotests: assertEquals -> assertEqual
Richard Purdie [Mon, 9 May 2016 13:03:41 +0000 (14:03 +0100)] 
tests: assertEquals -> assertEqual

The preferred form is assertEqual, assertEquals is deprecated and
not present in python v3.

This is v2.7 safe.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: Update logger.warn() -> logger.warning()
Richard Purdie [Mon, 9 May 2016 13:01:12 +0000 (14:01 +0100)] 
bitbake: Update logger.warn() -> logger.warning()

python deprecated logger.warn() in favour of logger.warning(). This is only
used in bitbake code so we may as well just translate everything to avoid
warnings under python 3. Its safe for python 2.7.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.{cooker, data}: only emit a var as python if 'func' is set
Christopher Larson [Sat, 30 Apr 2016 20:10:34 +0000 (13:10 -0700)] 
bb.{cooker, data}: only emit a var as python if 'func' is set

This avoids a common issue where PACKAGECONFIG is emitted as a function in
bitbake -e when the 'python' flag exists. It isn't a python function unless
both 'func' and 'python' are set. This aligns with the behavior of
emit_func_python.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.utils: let loaded plugins provide a plugin object
Christopher Larson [Sat, 30 Apr 2016 19:40:59 +0000 (12:40 -0700)] 
bb.utils: let loaded plugins provide a plugin object

This lets us avoid treating the module like an object, so no globals are
needed, if one chooses to do so.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.utils: use imp.get_suffixes for load_plugins
Christopher Larson [Sat, 30 Apr 2016 19:40:58 +0000 (12:40 -0700)] 
bb.utils: use imp.get_suffixes for load_plugins

Rather than hardcoding .py, use python's knowledge of its file extensions.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.utils: add load_plugins from scriptutils
Christopher Larson [Sat, 30 Apr 2016 19:40:57 +0000 (12:40 -0700)] 
bb.utils: add load_plugins from scriptutils

Imported as of oe-core 184a256.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.data_smart: use iter() for __len__
Christopher Larson [Sat, 30 Apr 2016 19:43:54 +0000 (12:43 -0700)] 
bb.data_smart: use iter() for __len__

It seems the frozenset constructor in pypy runs len(), so we can't pass the
DataSmart instance directly to it, instead pass the iterator. Fixes pypy
support.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.event: handle __builtins__ as a module
Christopher Larson [Sat, 30 Apr 2016 19:43:53 +0000 (12:43 -0700)] 
bb.event: handle __builtins__ as a module

Fixes pypy support.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.build: handle __builtins__ as a module
Christopher Larson [Sat, 30 Apr 2016 19:43:52 +0000 (12:43 -0700)] 
bb.build: handle __builtins__ as a module

Fixes pypy support.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: fetch2: Safer check for BB_ORIGENV datastore
Leonardo Sandoval [Tue, 3 May 2016 19:55:48 +0000 (14:55 -0500)] 
bitbake: fetch2: Safer check for BB_ORIGENV datastore

BB_ORIGENV value on the datastore can be NoneType thus raising an AttributeError
exception when calling the getVar method. To avoid this, a check is done before
accesing it.

[YOCTO #9567]

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: bin/toaster Fix noweb command
Michael Wood [Thu, 21 Apr 2016 13:22:06 +0000 (14:22 +0100)] 
toaster: bin/toaster Fix noweb command

For the noweb command we don't need to check if a socket is in use or
not as we're not starting the django development server. We're just
setting up the environment and running the runbuilds scheduler.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: bin/toaster Add ability to specify port and address to bind to
Michael Wood [Thu, 21 Apr 2016 13:22:05 +0000 (14:22 +0100)] 
toaster: bin/toaster Add ability to specify port and address to bind to

Allow binding to a specified address and port to start the django
development server on.
Remove the assumption that you want to bind to 0.0.0.0 and set the
default to localhost.
Add some additional help text after Toaster webserver has started

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: bin/toaster Add help text for unrecognised command
Michael Wood [Thu, 21 Apr 2016 13:22:04 +0000 (14:22 +0100)] 
toaster: bin/toaster Add help text for unrecognised command

Add help text for unrecognised or missing command for toaster script
Remove assumption that no command is 'start' as the default.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitake: main: fix line-too-long pytling warnings
Ed Bartosh [Mon, 25 Apr 2016 08:16:29 +0000 (11:16 +0300)] 
bitake: main: fix line-too-long pytling warnings

Wrapped long lines to fix "Line too long" pylint warnings.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: main: fix bad-continuation warnings
Ed Bartosh [Mon, 25 Apr 2016 08:16:28 +0000 (11:16 +0300)] 
bitbake: main: fix bad-continuation warnings

Fixed pylint warning 'Wrong continued indentation'.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: main: fix bad-witespace pylint warnings
Ed Bartosh [Mon, 25 Apr 2016 08:16:27 +0000 (11:16 +0300)] 
bitbake: main: fix bad-witespace pylint warnings

Fixed pylint warnings:
 No space allowed around keyword argument assignment
 No space allowed after bracket
 No space allowed before bracket

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: main: set defaults from env variables
Ed Bartosh [Wed, 20 Apr 2016 07:31:29 +0000 (10:31 +0300)] 
bitbake: main: set defaults from env variables

Environment variables BBSERVER, BBTOKEN and BBEVENTLOG silently
overwrite bitbake command line arguments. This is confusing and
can cause issues that are difficult to debug. It's better to use
them as default values instead.

Used environment variables BBSERVER, BBTOKEN and BBEVENTLOG to set
default values for command line arguments.

Changed setting default value of --ui command line argument from
BITBAKE_UI to look similar way.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: main: add 2 environment variables
Ed Bartosh [Wed, 20 Apr 2016 07:31:28 +0000 (10:31 +0300)] 
bitbake: main: add 2 environment variables

Bitbake uses set of environment variables to set command line
options, e.g. seeting BBTOKEN variable has the same effect
as using --token command line option.

Added new environment variables BBPRECONF and BBPOSTCONF that
are equivalents of --read and --postread command line options.
They can be used by high level scripts to append or prepend
configuration files to conf/local.conf

[YOCTO #9235]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: customrecipe Only show download icon or button if it's possible
Michael Wood [Tue, 26 Apr 2016 16:18:07 +0000 (17:18 +0100)] 
toaster: customrecipe Only show download icon or button if it's possible

If the based on recipe has not yet been checked out/cloned we cannot
generate the custom image recipe file that uses it. So disable/remove
the option to download it.

[YOCTO #9425]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: orm Add get_base_recipe_file to CustomImageRecipe
Michael Wood [Tue, 26 Apr 2016 16:18:06 +0000 (17:18 +0100)] 
toaster: orm Add get_base_recipe_file to CustomImageRecipe

This function returns the base recipe file path only if it currently
exists. This allows us to know whether we can proceed at this point with
generating a custom image recipe. It also enables us to call this
function from the templates to enable visual indication of this state.

Some whitespace fixes also added in generate_recipe_file_contents

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: Switch to post release version
Richard Purdie [Fri, 29 Apr 2016 06:41:34 +0000 (07:41 +0100)] 
bitbake: Switch to post release version

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2: export DBUS_SESSION_BUS_ADDRESS to support authentication agents
Ross Burton [Fri, 22 Apr 2016 15:56:50 +0000 (16:56 +0100)] 
fetch2: export DBUS_SESSION_BUS_ADDRESS to support authentication agents

Some users may want to use authenticated SSH connections with credentials stored
in a keyring, such as gnome-keyring.  These typically need a DBus session bus
connection, so pass DBUS_SESSION_BUS_ADDRESS into the fetcher environment.

To avoid the user needing to set it in their local.conf (which wouldn't be
usable) or adding it to the environment-cleansing whitelist (which would
potentially impact builds) allow the variables being passed to the fetchers to
come from the data store (first) or the original environment (second).

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: tests for build dashboard
Elliot Smith [Tue, 19 Apr 2016 16:28:47 +0000 (17:28 +0100)] 
toaster-tests: tests for build dashboard

Convert existing tests to Selenium.

Add basic tests to check that the modal contains radio buttons to select
a custom image to edit when a build built multiple custom images, and
to create a new custom image from one of the images built during
the build.

[YOCTO #9123]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: add modal to select custom image for editing
Elliot Smith [Tue, 19 Apr 2016 16:28:46 +0000 (17:28 +0100)] 
toaster: add modal to select custom image for editing

Add functionality to the placeholder button on the build dashboard
to open a modal dialog displaying editable custom images, in cases
where multiple custom images were built by the build. Where there
is only one editable custom image, go direct to its edit page.

The images shown in the modal are custom recipes for the project
which were built during the build shown in the dashboard.

This also affects the new custom image dialog, as that also has
to show custom image recipes as well as image recipes built during
the build. Modify the API on the Build object to support both.

Also modify and rename the queryset_to_list template filter so that
it can deal with lists as well as querysets, as the new custom image
modal has to show a list of image recipes which is an amalgam of two
querysets.

[YOCTO #9123]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: add build dashboard buttons to edit/create custom images
Elliot Smith [Tue, 19 Apr 2016 16:28:45 +0000 (17:28 +0100)] 
toaster: add build dashboard buttons to edit/create custom images

When a build is viewed in the dashboard, enable users to edit
a custom image which was built during that build, and/or create
a new custom image based on one of the image recipes built during
the build.

Add methods to the Build model to enable querying for the
set of image recipes built during a build.

Add buttons to the dashboard, with the "Edit custom image"
button opening a basic modal for now. The "New custom image"
button opens the existing new custom image modal, but is modified
to show a list of images available as a base for a new custom image.

Add a new function to the new custom image modal's script which
enables multiple potential custom images to be shown as radio
buttons in the dialog (if there is more than 1). Modify existing
code to use this new function.

Add a template filter which allows the queryset of recipes for
a build to be available to client-side scripts, and from there
be used to populate the new custom image modal.

[YOCTO #9123]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: make helper click on input before entering text
Elliot Smith [Tue, 19 Apr 2016 16:28:44 +0000 (17:28 +0100)] 
toaster-tests: make helper click on input before entering text

The Selenium helper's enter_text() method doesn't cause
keyup events to trigger unless the element where text is
being entered has been clicked.

Prefix all text entry with a click() on the element to ensure
that keyup events fire.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster-tests: add tests for new custom image page
Elliot Smith [Tue, 19 Apr 2016 16:28:43 +0000 (17:28 +0100)] 
toaster-tests: add tests for new custom image page

Test adding a new custom image when:

1. No custom images are in the project yet.
2. User tries to add custom image which duplicates the name of
an existing custom image.
3. User tries to add custom image which duplicates the name
of a non-image recipe.

[YOCTO #9209]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: prevent exception when Project.release is null
Elliot Smith [Tue, 19 Apr 2016 16:28:42 +0000 (17:28 +0100)] 
toaster: prevent exception when Project.release is null

Project.release can be null. This causes an exception when calling
get_all_compatible_layer_versions(), as the query to fetch
the layer versions references release.branch_name.

Add a guard to the function so that an empty queryset is returned
if the release isn't set for a project.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: only prevent duplicate custom image names within a project
Elliot Smith [Tue, 19 Apr 2016 16:28:41 +0000 (17:28 +0100)] 
toaster: only prevent duplicate custom image names within a project

We currently prevent the same name being used for multiple custom
images, but make the check across all projects. This means that
custom image names have to be unique across all projects in
the Toaster installation.

Modify how we validate the name of a custom image so that we
only prevent duplication of custom image names within a project,
while ensuring that the name of a custom image doesn't duplicate
the name of a recipe which is not a custom image recipe.

[YOCTO #9209]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: disable/enable "Add layer" button according to input's content
Elliot Smith [Tue, 19 Apr 2016 16:28:40 +0000 (17:28 +0100)] 
toaster: disable/enable "Add layer" button according to input's content

In the import layer page, the "Add layer" button in the layer dependencies
section doesn't accurately reflect whether the layer name in the
corresponding input can be added. A partial or empty layer name can
leave the button active, such that when it is clicked, a
previously-selected layer can be accidentally added.

Fix by keeping track of the items currently available in the typeahead,
only activating the "Add layer" button when the input matches the name
of one of those items.

[YOCTO #8511]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fix sorting after hiding a column in build tables
Elliot Smith [Tue, 19 Apr 2016 16:28:39 +0000 (17:28 +0100)] 
toaster: fix sorting after hiding a column in build tables

When hiding a column in the build tasks or build packages included
table, if the column is set as the current order by for the table, the
order by is not reset to the default. The result is that the table
stays sorted by the hidden column.

Set the default_orderby for these two tables correctly to ensure the
corresponding table is re-sorted when a column is hidden, if that column
was being used as the order by.

[YOCTO #9011]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: ensure ToasterTable headings are reset when order by changes
Michael Wood [Tue, 19 Apr 2016 16:28:38 +0000 (17:28 +0100)] 
toaster: ensure ToasterTable headings are reset when order by changes

If a ToasterTable is ordered by an optional column and that
column is subsequently hidden, the table ordering switches back
to the default ordering for the table. However, the table headings
don't update to reflect the new ordering. This is because the
code which sets the heading weight and hides/shows the caret symbols
only runs when the table is first loaded.

Store the default order by and re-apply it when the data is updated.

[YOCTO #9011]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agomain: fix processing of BBEVENTLOG
Ed Bartosh [Tue, 19 Apr 2016 13:54:39 +0000 (16:54 +0300)] 
main: fix processing of BBEVENTLOG

Fixed typo that caused incorrect processing of BBEVENTLOG
environment variable. Even if variable is set it was ignored
by bitbake.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils: add docstring for contains()
Ross Burton [Tue, 5 Apr 2016 14:46:41 +0000 (15:46 +0100)] 
lib/bb/utils: add docstring for contains()

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Updated the 'bitbake -h' output example.
Scott Rifenbark [Fri, 15 Apr 2016 16:20:19 +0000 (09:20 -0700)] 
bitbake-user-manual: Updated the 'bitbake -h' output example.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Updated "Conditional Metadata" section
Scott Rifenbark [Fri, 15 Apr 2016 16:14:12 +0000 (09:14 -0700)] 
bitbake-user-manual: Updated "Conditional Metadata" section

Added information about using lower-case characters and no
underscore characters when using OVERRIDES.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake-user-manual: Updated discussion about using "inherit"
Scott Rifenbark [Thu, 14 Apr 2016 15:53:26 +0000 (08:53 -0700)] 
bitbake-user-manual: Updated discussion about using "inherit"

Fixes [YOCTO #9343]

I updated the inherit directive section to note that you can
inherit multiple classes using a single line.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoproviders: Add PREFERRED_RPROVIDER support
Richard Purdie [Thu, 14 Apr 2016 13:30:52 +0000 (14:30 +0100)] 
providers: Add PREFERRED_RPROVIDER support

Sometimes you can end up in a situation where you need to specify that
a specific runtime entity should be provided by a specific entry.

An example of this is bluez where you could end up in a situation where
for example:

NOTE: multiple providers are available for runtime libasound-module-bluez (bluez4, bluez5)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libasound-module-bluez
NOTE: multiple providers are available for runtime bluez-hcidump (bluez-hcidump, bluez5)
NOTE: consider defining a PREFERRED_PROVIDER entry to match bluez-hcidump

The only option here is to set something like PREFERRED_PROVIDER_bluez4 = "bluez4"
which is clearly not very informative.

I've actually held off adding RPROVIDER support for a long while as this
does have sigificant potential for misuse. It doesn't for example allow
multiple runtime providers of the same name to coexist, that simply isn't
supported. It therefore doesn't replace some of the name mappings such
as busybox verses coreutils that OE-Core faces as that is a different
problem with different constraints. This mechanism is simply to provide
bitbake with a hint to decide what the dependency tree should look like.

Also, this allows us to stop printing a confusing message telling the user
to set PREFERRED_PROVIDER when the setting needed would be rather ambiguous.

[YOCTO #5044]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoproviders: We don't depend on previous build results
Richard Purdie [Thu, 14 Apr 2016 13:30:04 +0000 (14:30 +0100)] 
providers: We don't depend on previous build results

Back in history the code did depend on previous build results. This was
bad for determinism and we no longer do that. Update comments to match
the current behaviour.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker/knotty: Prefix parse logs with filename being parsed
Richard Purdie [Thu, 14 Apr 2016 13:29:27 +0000 (14:29 +0100)] 
cooker/knotty: Prefix parse logs with filename being parsed

We now prefix log messages coming from worker task context with the
PF and task info, however parsing messages all have to be manually
prefixed which is ugly and error prone. This change modifies the log
handler filter so this happens automatically, meaning we don't have
to change every message to include that information. This makes error
messages longer but more usable.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: pass exception to finishAsyncCommand
Richard Purdie [Mon, 29 Feb 2016 14:23:33 +0000 (14:23 +0000)] 
cooker: pass exception to finishAsyncCommand

An invalid task causes bitbake to exit incorrectly, firing a
CommandCompleted event rather than a CommandFailed one. This
means that clients listening for CommandFailed events are
unable to detect the build failure even though one occurred.

Passing an exception string to finishAsyncCommand when a task
fails causes the CommandFailed event to be fired correctly.

[YOCTO #9087]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Improve 'mulitiple .bb files are due to be built' message
Richard Purdie [Sun, 10 Apr 2016 10:09:21 +0000 (11:09 +0100)] 
runqueue: Improve 'mulitiple .bb files are due to be built' message

When multiple recipes which both provide something are being built, bitbake
informs us that most likely one of them provides something the other doesn't,
which is usually correct, but unfortunately it's rather painful to figure out
exactly what that is.

This patch dumps two sets of information, one is the provides information for
each recipe, filtered so only common components are removed. The other is a list
of dependees on the recipe, since sometimes this can easily identify why something
is being built.

Its not straightforward for bitbake to obtain the information but since the
warning/error code path isn't the normal one, we can afford to go through some
less than optimal processing to aid debugging.

Also provide the same information even if we're showing a warning since its still
useful.

[YOCTO #8032]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fixes for customimage package not found
Dave Lerner [Fri, 8 Apr 2016 08:39:28 +0000 (09:39 +0100)] 
toaster: fixes for customimage package not found

For a custom image, if a search for a package results in no packages
found, then additional information should be presented to the user.
This is different than a 'no results' found for a search in other
contexts, for example, a search for a package in a non-customised build.
For a custom image, a package search failure can happen because the
package was not added to the custom image. This commit presents more
information to the user, suggesting why the package was not found in the
custom image.
The generic table view handling js changes to handle a new div
element no-results-special-... such that, if present, that template
section is shown rather than the default no-results-... section.

[YOCTO #9154]

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata_smart: Restrict expansion regexp to not include : characters
Richard Purdie [Fri, 8 Apr 2016 22:47:58 +0000 (23:47 +0100)] 
data_smart: Restrict expansion regexp to not include : characters

Bitbake variables don't include ":" characters so exclude these from the variable
expansion regexp.

This assists when parsing shell code which does A=${B:-C} as we don't want a
dependency on a variable called "B:-C".

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotests/utils.py: test origvalue in a callback matches what is expected
Randy Witt [Thu, 7 Apr 2016 06:55:40 +0000 (23:55 -0700)] 
tests/utils.py: test origvalue in a callback matches what is expected

There were no tests that verified the value of origvalue in the callback
routines used by edit_metadata(). This patch adds one for a simple
multiline variable.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils.py: Fix a bug in edit_metadata() that could corrupt vars
Randy Witt [Thu, 7 Apr 2016 06:55:39 +0000 (23:55 -0700)] 
lib/bb/utils.py: Fix a bug in edit_metadata() that could corrupt vars

edit_metadata() would corrupt a variable that was multiline, but
had the ending quotes on the same line as the last value. For example:

    TEST_VAR = " foo \
    bar"

would become " foo ba" because the code would always delete the last
character on the line and then do it again if the line ended in the
quote. This however doesn't show up if you have:

    TEST_VAR = " foo \
    bar \
    "

which is how all the test cases were written.

This patch fixes that bug and adds and fixes a test that matched the bugs
behavior rather than the expected behavior.

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoUpdate version to 1.30.0
Richard Purdie [Wed, 6 Apr 2016 22:31:27 +0000 (23:31 +0100)] 
Update version to 1.30.0

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: update LICENSE file with QUnit details
Elliot Smith [Wed, 6 Apr 2016 13:49:13 +0000 (14:49 +0100)] 
bitbake: update LICENSE file with QUnit details

QUnit is now included in Toaster's test suite and distributed
with its source code.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotests: browser Add test to run the js unit tests
Michael Wood [Mon, 4 Apr 2016 10:52:49 +0000 (11:52 +0100)] 
tests: browser Add test to run the js unit tests

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: views jsunittest Add MACHINE and an extra layer to test project
Michael Wood [Mon, 4 Apr 2016 10:47:31 +0000 (11:47 +0100)] 
toaster: views jsunittest Add MACHINE and an extra layer to test project

Add set a MACHINE if needed and add a layer. When we're running in the
context of the django unit tests we don't have these defaults setup for
the project so add them.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests Set MACHINE for the test projects
Michael Wood [Fri, 1 Apr 2016 10:47:32 +0000 (11:47 +0100)] 
toaster: tests Set MACHINE for the test projects

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Add quint to project so that it can be used offline
Michael Wood [Fri, 1 Apr 2016 10:32:35 +0000 (11:32 +0100)] 
toaster: Add quint to project so that it can be used offline

Currently we're using a hosted version of quint however this means that the
testing has to be online or have a cached version of quint. Add the
files to Toaster to be able to use offline.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: add rev dep column to image detail pages
Dave Lerner [Wed, 6 Apr 2016 13:44:41 +0000 (14:44 +0100)] 
toaster: add rev dep column to image detail pages

Add a column to the custom image pages that shows the reverse
dependencies in a format matching the dependencies column:
  - either blank or a button showing the count of reverse dependencies,
  - when the button is clicked, a popover appears showing the list
    of reverse dependencies, with each package's size, and the total
    size of all of the reverse dependencies.

The implementation adds a packages table method to retreive the reverse
dependency total size, and adds a separate 'popover' html template. Both
of these changes follow the pattern for the dependencies column.

[YOCTO #9163]

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuildinfohelper: work around unicode exceptions
Joshua Lock [Wed, 6 Apr 2016 12:50:23 +0000 (13:50 +0100)] 
buildinfohelper: work around unicode exceptions

We have been seeing UnicodeDecodeErrors when handling the
ImagePkgList MetadataEvent in ORMWrapper's
save_target_file_information() if the event includes filenames
that include non-ASCII characters.

In the short term work around this by converting paths to the
unicode type when passing them to Django's ORM. This is a bit of
a hack but it's too late in the cycle to do anything more invasive.

[YOCTO #9142]

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoasterui: update build in internal state
Ed Bartosh [Wed, 6 Apr 2016 16:46:48 +0000 (17:46 +0100)] 
toasterui: update build in internal state

buildinfohelper stores current Build object in its internal
state. Any changes to Build object will be lost if internal
state is not updated as current buildinfohelper code
saves Build object from internal state when build is
completed.

This bug causes incorrect build state when build is cancelled.
Updating internal state should fix it.

Note, that this commit updates internal state after status of
the build is changed to Build.CANCELLED. There are several other
places in the code where Build object is updated without updating
internal state. They should be carefully analyzed and fixed.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuildinfohelper: fix KeyError
Ed Bartosh [Wed, 6 Apr 2016 16:46:47 +0000 (17:46 +0100)] 
buildinfohelper: fix KeyError

When bitbake doesn't need to build anything it still sends
ImagePkgList event with empty 'pkgdata', 'imgdata' and 'filedata'
fields. This causes crash in buildinfohelper code as it's assumed
that above mentioned fields always have data keyed by build target:

ERROR: u'core-image-minimal'
Traceback (most recent call last):
  File "toasterui.py", line 423, in main
    buildinfohelper.store_target_package_data(event)
  File "buildinfohelper.py", line 1218, in store_target_package_data
    imgdata = BuildInfoHelper._get_data_from_event(event)['imgdata'][target.target]
KeyError: u'core-image-minimal'

Fixed this by using dict.get method with empty dictionary as default
return value instead of trying to get value without checking if target
key is in the data.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: get bitbake location from BBBASEDIR
Ed Bartosh [Wed, 6 Apr 2016 16:46:46 +0000 (17:46 +0100)] 
toaster: get bitbake location from BBBASEDIR

It was incorrectly assumed in the current code that bitbake is in
../bitbake/bin/ directory. It's not always the case.
Using bitbake from $BBBASEDIR should be .

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>