]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
8 years agotoaster: layer details Fix "edit" form interaction
Belen Barros Pena [Mon, 5 Sep 2016 14:29:26 +0000 (15:29 +0100)] 
toaster: layer details Fix "edit" form interaction

Make sure the layer information disappears when the edit form shows, and
that the layer details come back when you click the 'cancel' button in
the edit form.

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotoaster: import layer Layout fixes
Belen Barros Pena [Mon, 5 Sep 2016 14:29:25 +0000 (15:29 +0100)] 
toaster: import layer Layout fixes

The layout of the import layer form was looking a bit awkward. This
commit tidies things up a bit.

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotoaster: layer details Layout fixes
Belen Barros Pena [Mon, 5 Sep 2016 14:29:24 +0000 (15:29 +0100)] 
toaster: layer details Layout fixes

The layout of the layer details page was looking a bit awkward. This
commit tidies things up.

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotoaster: configuration Provide machine help text
Belen Barros Pena [Mon, 5 Sep 2016 14:29:23 +0000 (15:29 +0100)] 
toaster: configuration Provide machine help text

When you change the machine from the project configuration page, you get
some useful suggestions as you start typing a machine name. However, the
suggestions only include machines provided by the layers added to your
project. This is not necessarily clear from the design (yes, it should
be improved), which means you might be looking for a machine, not see it
in the suggestions, and assume the machine is not supported by
OpenEmbedded.

Since we are in no position to change the design of this page right now,
add some explanatory help text to address the situation.

[YOCTO #8034]

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotoaster: tasks Remove recipe version from defaults
Belen Barros Pena [Mon, 5 Sep 2016 14:29:22 +0000 (15:29 +0100)] 
toaster: tasks Remove recipe version from defaults

The 'Recipe version' column should not be part of the set of columns
shown by default in the tasks table. Set the hidden property for that
column to 'True' so that it doesn't show when you load that table
for the first time.

[YOCTO #10179]

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agolib/bb/utils: edit_metadata() comment tweaks
Paul Eggleton [Mon, 5 Sep 2016 22:57:33 +0000 (10:57 +1200)] 
lib/bb/utils: edit_metadata() comment tweaks

No functional changes, just make a couple of minor tweaks to the
comments for edit_metadata():

* There are four elements to be returned by the callback function
* Add an example return statement for when you don't want to modify the
  value

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agofetch2/npm: clarify comment
Paul Eggleton [Mon, 5 Sep 2016 22:57:32 +0000 (10:57 +1200)] 
fetch2/npm: clarify comment

The correct name of the parameter is "version" not "ver" so ensure we
aren't misleading the user by giving the latter in an example.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agofetch2/npm: handle top-level shrinkwrap file
Paul Eggleton [Mon, 5 Sep 2016 22:57:31 +0000 (10:57 +1200)] 
fetch2/npm: handle top-level shrinkwrap file

Allow using a top-level shrinkwrap file with one or more npm://
dependencies, i.e. if the module isn't found at the top level then look
one level down.

Part of the fix for [YOCTO #9537].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agofetch2/npm: support subdir= parameter
Paul Eggleton [Mon, 5 Sep 2016 22:57:30 +0000 (10:57 +1200)] 
fetch2/npm: support subdir= parameter

"npmpkg" can be a default, but it should respect the subdir parameter as
with other FetchMethods. This allows us to have more than one npm://
entry in SRC_URI without nasty hacks.

Fix required in order to support [YOCTO #9537].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agofetch2/npm: fix broken fetches if more than one npm URL fetched
Paul Eggleton [Mon, 5 Sep 2016 22:57:29 +0000 (10:57 +1200)] 
fetch2/npm: fix broken fetches if more than one npm URL fetched

You cannot set a URL-specific value in an object-level variable on
the FetchMethod in urldata_init() or the result is the value specific to
the last URL will be the one that gets set. This prevented fetching more
than one npm:// URL correctly - the other tarballs would not download to
the correct location and do_unpack failed to find them as a result.

Fix required in order to support [YOCTO #9537].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agofetch2/npm: explicitly specify workdir
Paul Eggleton [Mon, 5 Sep 2016 22:57:28 +0000 (10:57 +1200)] 
fetch2/npm: explicitly specify workdir

We were downloading into the current directory here, which is fine if
that current directory can be expected to be the right place - but
that's not true when called from recipetool within OE. We should
explicitly specify the directory to run the command in and then there
won't be a problem.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobb.fetch2.svn: correctly pass workdir when fetching
Christopher Larson [Wed, 31 Aug 2016 19:57:08 +0000 (12:57 -0700)] 
bb.fetch2.svn: correctly pass workdir when fetching

The ud.pkgdir argument was being passed as the 'quiet' argument to
runfetchcmd, not the 'workdir' argument, resulting in fetching the svn module
into the root of DL_DIR, not where it belongs.

Cc: Matt Madison <matt@madison.systems>
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agocooker.py: Catch when stdout doesn't have a file descriptor
Mariano Lopez [Tue, 23 Aug 2016 07:06:11 +0000 (07:06 +0000)] 
cooker.py: Catch when stdout doesn't have a file descriptor

Currently, there is a check to remove the TOSTOP attribute from
a tty to avoid hangs. It assumes that sys.stdout will have a
file descriptor and this is not always true, some IO classes
will throw exceptions when trying to get its file descriptor.

This will add a check for such cases and avoid throwing an
exception.

[YOCTO #10162]

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotoaster: localhostbecontroller Remove git assumption
Michael Wood [Mon, 22 Aug 2016 15:42:36 +0000 (16:42 +0100)] 
toaster: localhostbecontroller Remove git assumption

We don't need to force everyone to use git for the method in which
openembedded-core is downloaded. For instance it could have been
downloaded and extracted as a tarball.

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>
8 years agotoaster: Allow git information to be null for BRLayer
Michael Wood [Mon, 22 Aug 2016 15:42:35 +0000 (16:42 +0100)] 
toaster: Allow git information to be null for BRLayer

We no longer only deal with layers that have their source in a gir
repository, we also allow for local directories too so update the
BRLayer model to reflect this.

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>
8 years agotoaster: tests Add selenium test layer source switching layer details page
Michael Wood [Mon, 22 Aug 2016 15:42:34 +0000 (16:42 +0100)] 
toaster: tests Add selenium test layer source switching layer details page

Add selenium tests for the new layer source switching functionality on
the layer details page. Edits the values for git repository and saves
and then edits the details for directory information and saves.

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>
8 years agotoaster: Move Custom image recipe rest api to api file
Michael Wood [Mon, 22 Aug 2016 15:42:33 +0000 (16:42 +0100)] 
toaster: Move Custom image recipe rest api to api file

We now have a dedicated file for the rest API so move and rework for
class based views. Also clean up all flake8 identified warnings.

Remove unused imports from toastergui views.

The original work for this API was done by Elliot Smith, Ed Bartosh,
Michael Wood and Dave Lerner

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>
8 years agotoaster: Fix oe-core fixture
Michael Wood [Mon, 22 Aug 2016 15:42:32 +0000 (16:42 +0100)] 
toaster: Fix oe-core fixture

Due to a copy paste error we managed to get some of the wrong
information in the oe fixture that provides a suggested default settings
for Toaster. This meant it tested correctly when it shouldn't have.
Fix:
 - The use of local bitbake
 - An incorrect call to realpath which didn't include its parent module.
 - The field used for the local_dir of an existing openembedded-core

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>
8 years agotoaster: layerdetails clean ups after integrating local layer changes
Michael Wood [Mon, 22 Aug 2016 15:42:31 +0000 (16:42 +0100)] 
toaster: layerdetails clean ups after integrating local layer changes

A few clean ups for the work done to integrate editing imported local layers
into the layer detail page.

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>
8 years agotoaster: update api to include local_source_dir
Sujith H [Mon, 22 Aug 2016 15:42:30 +0000 (16:42 +0100)] 
toaster: update api to include local_source_dir

Add an additional argument to the api to handle
local_source_dir which is the value user passes
to import non-git layers.

[YOCTO #9913]

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>
8 years agotoaster: layerdetails js changes for switching layers
Sujith H [Mon, 22 Aug 2016 15:42:29 +0000 (16:42 +0100)] 
toaster: layerdetails js changes for switching layers

This patch helps to implement the switching of layers
between directories and git repositories. Specifically
selection of git and local directory. Also enabling
form to view the selection.

[YOCTO #9913]

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>
8 years agotoaster: add switch of git and not-git layers imported
Sujith H [Mon, 22 Aug 2016 15:42:28 +0000 (16:42 +0100)] 
toaster: add switch of git and not-git layers imported

This patch updates the layerdetails html file to
add the feature of switching imported layers between
directories and git repositories.

[YOCTO #9913]

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>
8 years agobuildinfohelper: discover kernel artifacts correctly
Elliot Smith [Tue, 23 Aug 2016 11:18:26 +0000 (14:18 +0300)] 
buildinfohelper: discover kernel artifacts correctly

Because some image_license.manifest files contain multiple
FILES lines, and because those lines can sometimes not contain
a list of files (i.e. they look like "FILES:\n"), we were
resetting the list of kernel artifacts when we hit the second
"empty" line.

Fix by ignoring any FILES line which doesn't list files, and by
appending any files found in a valid FILES line, rather than
overwriting the existing list.

[YOCTO #10107]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agowget: allow basic http auth for SSTATE_MIRRORS
Stephano Cetola [Fri, 26 Aug 2016 17:41:43 +0000 (10:41 -0700)] 
wget: allow basic http auth for SSTATE_MIRRORS

If http basic auth creds were added to sstate mirrors like so:

https://foo.com/sstate/PATH;user=foo:bar;downloadfilename=PATH

The sstate mirror check would silently fail with 401 unauthorized.
This patch allows both the check, and the wget download to succeed by
checking for user credentials and if present adding the correct
headers, or wget params as needed.

[ YOCTO #9815 ]

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agocookerdata/ast: Fail gracefully if event handler function is not found
Markus Lehtonen [Tue, 30 Aug 2016 09:53:30 +0000 (12:53 +0300)] 
cookerdata/ast: Fail gracefully if event handler function is not found

[YOCTO #10186]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobuild/runqueue: Add noextra stamp file parameter to fix multiconfig builds
Richard Purdie [Wed, 31 Aug 2016 10:37:53 +0000 (11:37 +0100)] 
build/runqueue: Add noextra stamp file parameter to fix multiconfig builds

We can't execute the same task for the same package_arch multiple
times as the current setup has conflicting directories. Since
these would usually have the same stamp/hash, we want to execute in
sequence rather than in parallel, so for the purposes of task execution,
don't consider the "extra-info" on the stamp files. We need to add
a parameter to the stamp function to achieve this.

This avoids multiple update-rc.d populate_sysroot tasks executing in
parallel and breaking multiconfig builds.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agofetch2: Handle multiconfig fetcher issues
Richard Purdie [Wed, 31 Aug 2016 10:34:23 +0000 (11:34 +0100)] 
fetch2: Handle multiconfig fetcher issues

We need a separate fetcher cache per multiconfig as the revisions and other
SRC_URI data can potentially be different. For now, this is the simplest way
to achieve that and avoids linux-yocto kernel build failures when targeting
multiple machines for example.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotinfoil: add a parse_recipe_file function
Paul Eggleton [Tue, 30 Aug 2016 02:16:22 +0000 (14:16 +1200)] 
tinfoil: add a parse_recipe_file function

Parsing a recipe is such a common task for tinfoil-using scripts, and is
a little awkward to do properly, so add an API function to do it. This
should also isolate scripts a little from future changes to the internal
code. The first user of this will be the OpenEmbedded layer index update
script.

Part of the fix for [YOCTO #10192].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
8 years agocache: allow parsing a recipe with a custom config datastore
Paul Eggleton [Tue, 30 Aug 2016 08:45:09 +0000 (20:45 +1200)] 
cache: allow parsing a recipe with a custom config datastore

To accommodate the OpenEmbedded layer index recipe parsing, we have to
have the ability to pass in a custom config datastore since it
constructs a synthetic one. To make this possible after the multi-config
changes, rename the internal _load_bbfile() function to parse_recipe(),
make it a function at the module level (since it doesn't actually need
to access any members of the class or instance) and move setting
__BBMULTICONFIG inside it since other code will expect that to be set.

Part of the fix for [YOCTO #10192].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
8 years agobitbake-diffsigs/bitbake-layers: Ensure tinfoil is shut down correctly
Paul Eggleton [Wed, 5 Aug 2015 14:47:12 +0000 (15:47 +0100)] 
bitbake-diffsigs/bitbake-layers: Ensure tinfoil is shut down correctly

We should always shut down tinfoil when we're finished with it, either
by explicitly calling the shutdown() method or by using it as a
context manager ("with ...").

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
8 years agotinfoil: add context manager functions
Paul Eggleton [Wed, 5 Aug 2015 14:12:14 +0000 (15:12 +0100)] 
tinfoil: add context manager functions

Since calling the shutdown() function is highly recommended, make
tinfoil objects a little easier to deal with by adding context manager
support - so you can do the following:

    with bb.tinfoil.Tinfoil() as tinfoil:
        tinfoil.prepare(True)
        ...

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
8 years agobitbake-user-manual: Added "Exporting Variables to the Environment"
Scott Rifenbark [Thu, 1 Sep 2016 21:01:21 +0000 (14:01 -0700)] 
bitbake-user-manual: Added "Exporting Variables to the Environment"

Fixes [YOCTO #10196]

Added a new section named "Exporting Variables to the Environment".
This section provides a dedicated description for how to export
variables to the shell.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
8 years agobitbake-user-manual: Corrected misspelled STAMPS_DIR
Scott Rifenbark [Mon, 22 Aug 2016 20:07:58 +0000 (13:07 -0700)] 
bitbake-user-manual: Corrected misspelled STAMPS_DIR

Fixes [YOCTO #10141]

Section on Checksums (Signatures) had this variable referred to as
STAMP_DIR.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
8 years agofetch2: clean up remaining cwd saves/changes
Matt Madison [Sun, 21 Aug 2016 15:02:46 +0000 (08:02 -0700)] 
fetch2: clean up remaining cwd saves/changes

Now that the fetchers all preserve the current working
directory, the cwd changes in the try_mirror_url,
download, and checkstatus methods are no longer needed.

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agosiggen: Fix file variable typo in compare_sigfiles
Jonathan Liu [Sat, 20 Aug 2016 08:58:13 +0000 (18:58 +1000)] 
siggen: Fix file variable typo in compare_sigfiles

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agofetch2: preserve current working directory
Matt Madison [Wed, 10 Aug 2016 17:08:16 +0000 (10:08 -0700)] 
fetch2: preserve current working directory

Fix the methods in all fetchers so they don't change
the current working directory of the calling process, which
could lead to "changed cwd" warnings from bitbake.

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agodump_cache.py: use python3 as interpreter
Robert Yang [Thu, 18 Aug 2016 08:26:13 +0000 (01:26 -0700)] 
dump_cache.py: use python3 as interpreter

Fixed:
  File "bitbake/contrib/dump_cache.py", line 39
    print("Error, need one argument!", file=sys.stderr)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotoasterui, knotty: don't print taskid followed by taskstring which are now in most...
Martin Jansa [Thu, 18 Aug 2016 15:06:29 +0000 (17:06 +0200)] 
toasterui, knotty: don't print taskid followed by taskstring which are now in most cases identical

* unify the format how the task is described
* don't show taskid followed by taskstring as the taskstring is
  different only for setscene tasks (by _setscene suffix)
* the duplicated output was introduced by:
  2c88afb   taskdata/runqueue: Rewrite without use of ID indirection
  as reported and confirmed as a bug here:
  http://lists.openembedded.org/pipermail/openembedded-core/2016-June/123148.html
* show:
  NOTE: Running task 541 of 548 (/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package)
  instead of much longer:
  NOTE: Running task 541 of 548 (ID: /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package, /OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_package)

  and similarly for failed tasks:
  ERROR: Task (virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install) failed with exit code '1'
  instead of much longer:
  ERROR: Task virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install (virtual:native:/OE/build/oe-core/openembedded-core/meta/recipes-core/zlib/zlib_1.2.8.bb:do_install) failed with exit code '1'

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotests: add unit tests for the usehead url parameter
Markus Lehtonen [Thu, 18 Aug 2016 16:12:02 +0000 (19:12 +0300)] 
tests: add unit tests for the usehead url parameter

[YOCTO #9351]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agogit: Allow local repos to use HEAD
Richard Purdie [Thu, 18 Aug 2016 16:12:01 +0000 (19:12 +0300)] 
git: Allow local repos to use HEAD

Introduce a new 'usehead' url parameter for git repositories. Specifying
usehead=1 causes bitbake to use whatever commit the repository HEAD is
pointing to. Usage of usehead=1 is only allowed for local git
repositories, i.e. it must always be accompanied with protocol=file url
parameter.

[YOCTO #9351]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-selftest: enable bitbake logging to stdout
Markus Lehtonen [Thu, 18 Aug 2016 16:55:54 +0000 (19:55 +0300)] 
bitbake-selftest: enable bitbake logging to stdout

Now you get the bb logger output for failed tests. This helps debugging
problems. Also, all stdout/stderr data for successful tests is silenced
which makes for less cluttered console output.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-selftest: introduce BB_TMPDIR_NOCLEAN
Markus Lehtonen [Thu, 18 Aug 2016 16:55:53 +0000 (19:55 +0300)] 
bitbake-selftest: introduce BB_TMPDIR_NOCLEAN

Set this env variable to 'yes' to preserve temporary directories used by
the fetcher tests. Useful for debugging tests.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-selftest: add help text for env variable(s)
Markus Lehtonen [Thu, 18 Aug 2016 16:55:52 +0000 (19:55 +0300)] 
bitbake-selftest: add help text for env variable(s)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-selftest: utilize unittest.main better
Markus Lehtonen [Thu, 18 Aug 2016 16:55:51 +0000 (19:55 +0300)] 
bitbake-selftest: utilize unittest.main better

This simplifies the script, and, gives new features. It is now possible
to run single test functions, for example. This is nice when writing new
test cases.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake: Update version to 1.31.1
Richard Purdie [Thu, 18 Aug 2016 09:05:26 +0000 (10:05 +0100)] 
bitbake: Update version to 1.31.1

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake: Initial multi-config support
Richard Purdie [Tue, 16 Aug 2016 16:47:06 +0000 (17:47 +0100)] 
bitbake: Initial multi-config support

This patch adds the notion of supporting multiple configurations within
a single build. To enable it, set a line in local.conf like:

BBMULTICONFIG = "configA configB configC"

This would tell bitbake that before it parses the base configuration,
it should load conf/configA.conf and so on for each different
configuration. These would contain lines like:

MACHINE = "A"

or other variables which can be set which can be built in the same
build directory (or change TMPDIR not to conflict).

One downside I've already discovered is that if we want to inherit this
file right at the start of parsing, the only place you can put the
configurations is in "cwd", since BBPATH isn't constructed until the
layers are parsed and therefore using it as a preconf file isn't
possible unless its located there.

Execution of these targets takes the form "bitbake
multiconfig:configA:core-image-minimal core-image-sato" so similar to
our virtclass approach for native/nativesdk/multilib using BBCLASSEXTEND.

Implementation wise, the implication is that instead of tasks being
uniquely referenced with "recipename/fn:task" it now needs to be
"configuration:recipename:task".

We already started using "virtual" filenames for recipes when we
implemented BBCLASSEXTEND and this patch adds a new prefix to
these, "multiconfig:<configname>:" and hence avoid changes to a large
part of the codebase thanks to this. databuilder has an internal array
of data stores and uses the right one depending on the supplied virtual
filename.

That trick allows us to use the existing parsing code including the
multithreading mostly unchanged as well as most of the cache code.

For recipecache, we end up with a dict of these accessed by
multiconfig (mc). taskdata and runqueue can only cope with one recipecache
so for taskdata, we pass in each recipecache and have it compute the result
and end up with an array of taskdatas. We can only have one runqueue so there
extensive changes there.

This initial implementation has some drawbacks:

a) There are no inter-multi-configuration dependencies as yet

b) There are no sstate optimisations. This means if the build uses the
same object twice in say two different TMPDIRs, it will either load from
an existing sstate cache at the start or build it twice. We can then in
due course look at ways in which it would only build it once and then
reuse it. This will likely need significant changes to the way sstate
currently works to make that possible.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agosiggen: properly close files rather than opening them inline
Paul Eggleton [Thu, 11 Aug 2016 03:37:00 +0000 (15:37 +1200)] 
siggen: properly close files rather than opening them inline

If you don't do this, with Python 3 you get a warning on exit under some
circumstances.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agoast/ConfHandler: Add a syntax to clear variable
Jérémy Rosen [Tue, 16 Aug 2016 12:04:47 +0000 (14:04 +0200)] 
ast/ConfHandler: Add a syntax to clear variable

unset VAR
will clear variable VAR
unset VAR[flag]
will clear flag "flag" from var VAR

Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agocache: Build datastores from databuilder object
Richard Purdie [Mon, 15 Aug 2016 17:03:29 +0000 (18:03 +0100)] 
cache: Build datastores from databuilder object

Rather than passing in a datastore to build on top of, use the data builder
object in the cache and base the parsed recipe from this. This turns
things into proper objects building from one another rather than messy
mixes of static and class functions.

This sets things up so we can support parsing and building multiple
configurations.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agocache: Split Cache() into a NoCache() parent object
Richard Purdie [Mon, 15 Aug 2016 17:02:41 +0000 (18:02 +0100)] 
cache: Split Cache() into a NoCache() parent object

There are some cases we want to parse recipes without any cache
setup or involvement. Split out the standalone functions into
a NoCache variant which the Cache is based upon, setting the scene
for further cleanup and restructuring.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agocache/cooker: Pass databuilder into bb.cache.Cache()
Richard Purdie [Mon, 15 Aug 2016 17:01:54 +0000 (18:01 +0100)] 
cache/cooker: Pass databuilder into bb.cache.Cache()

Rather that the current mix of static and class methods, refactor
so that the cache has the databuilder object internally. This becomes
useful for the following patches for multi config support.

It effectively completes some of the object oriented work we've been
working towards in the bitbake core for a while.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agocache: Make virtualfn2realfn/realfn2virtual standalone functions
Richard Purdie [Mon, 15 Aug 2016 17:00:45 +0000 (18:00 +0100)] 
cache: Make virtualfn2realfn/realfn2virtual standalone functions

Needing to access these static methods through a class doesn't
make sense. Move these to become module level standalone functions.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agocache/ast: Move __VARIANTS handling to parse cache function
Richard Purdie [Mon, 15 Aug 2016 16:59:56 +0000 (17:59 +0100)] 
cache/ast: Move __VARIANTS handling to parse cache function

Simple refactoring to allow for multiconfig support.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agorunqueue: Abstract worker functionality to an object/array
Richard Purdie [Mon, 15 Aug 2016 16:58:39 +0000 (17:58 +0100)] 
runqueue: Abstract worker functionality to an object/array

With the introduction of multi-config and the possibility of distributed
builds we need arrays of workers rather than the existing two.

This refactors the code to have a dict() of workers and a dict of
fakeworkers, represented by objects. The code can iterate over these.

This is separated out from the multi-config changes since its separable
and clearer this way.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agocookerdata: Simplify prefiles/postfiles
Richard Purdie [Mon, 15 Aug 2016 16:57:20 +0000 (17:57 +0100)] 
cookerdata: Simplify prefiles/postfiles

The current codepaths are rather confusing. Stop passing these
as parameters and use the ones from when the object is created.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-user-manual: Re-write "Dependencies Internal to the .bb File"
Scott Rifenbark [Fri, 12 Aug 2016 16:17:02 +0000 (09:17 -0700)] 
bitbake-user-manual: Re-write "Dependencies Internal to the .bb File"

Fixes [YOCTO #10117]

Applied a re-write to better clarify the behavior of dependencies.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-user-manual: Added setting variable for a single task
Scott Rifenbark [Mon, 8 Aug 2016 16:38:00 +0000 (09:38 -0700)] 
bitbake-user-manual: Added setting variable for a single task

Fixes [YOCTO #10095]

I added a third case to the "Conditional Metadata" section to
describe setting a variable for a single task.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-user-manual: Added more detail to anonymous Python functions.
Scott Rifenbark [Mon, 8 Aug 2016 15:54:41 +0000 (08:54 -0700)] 
bitbake-user-manual: Added more detail to anonymous Python functions.

Fixes [YOCTO #10093]

Provided much more detail on how these functions work.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-user-manual: Formatted all "flags" to be consistent
Scott Rifenbark [Thu, 4 Aug 2016 00:44:53 +0000 (17:44 -0700)] 
bitbake-user-manual: Formatted all "flags" to be consistent

Fixes [YOCTO #10071]

The use of any flags throughout the manual was very inconsistent.
I changed all references to any named flag in the text to be
formatted as code and to be enclosed in square brackets.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobitbake-user-manual: Added detail to [dirs] and [cleardirs] flags
Scott Rifenbark [Thu, 4 Aug 2016 00:22:58 +0000 (17:22 -0700)] 
bitbake-user-manual: Added detail to [dirs] and [cleardirs] flags

Fixes [YOCTO #10071]

Provided more clear descriptions for these two flags.

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agobb/utils.py: export_proxies add GIT_PROXY_COMMAND
Francisco Pedraza [Wed, 10 Aug 2016 21:00:04 +0000 (16:00 -0500)] 
bb/utils.py: export_proxies add GIT_PROXY_COMMAND

This was added to enable the usage of git through proxies.

Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agoknotty: don't show number of running tasks in quiet mode
Paul Eggleton [Thu, 11 Aug 2016 03:36:59 +0000 (15:36 +1200)] 
knotty: don't show number of running tasks in quiet mode

There's not a whole lot of point showing how many tasks are running when
we're in quiet mode, it just looks a bit strange particularly when it's
not running any tasks.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agoknotty: fix task progress bar not starting at 0%
Paul Eggleton [Thu, 11 Aug 2016 03:36:58 +0000 (15:36 +1200)] 
knotty: fix task progress bar not starting at 0%

If we have the task number here we need to subtract 1 to get the number
of tasks completed.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agorunqueue: fix two minor issues with the initialising tasks progress
Paul Eggleton [Thu, 11 Aug 2016 03:36:57 +0000 (15:36 +1200)] 
runqueue: fix two minor issues with the initialising tasks progress

A couple of fixes for the "Initialising tasks" progress bar behaviour:
* Properly finish the progress bar when using bitbake -S
* Finish the progress bar before calling BB_HASHCHECK_FUNCTION (so that
  in OE when that shows its own "Checking sstate mirror object
  availability"  progress bar it gets shown on the next line as it
  should).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agolib/bb/tests/fetch: remove URL that doesn't exist anymore
Ross Burton [Mon, 15 Aug 2016 14:20:50 +0000 (15:20 +0100)] 
lib/bb/tests/fetch: remove URL that doesn't exist anymore

The CUPS ipptool URL we were checking now redirects to github where the tarball
isn't present, so remove it from the test suite.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
8 years agotoaster: update web urls for openembedded-core's special case
David Reyna [Mon, 15 Aug 2016 10:41:33 +0000 (11:41 +0100)] 
toaster: update web urls for openembedded-core's special case

The layer index update command has a special case for the
updating 'openembedded-core' layer, and it was missing reading
and updating the git web URL fields.

[YOCTO #8037]

Signed-off-by: David Reyna <david.reyna@windriver.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: buildinfohelper Add handling local layers (i.e. non-git) layers
Michael Wood [Tue, 9 Aug 2016 12:50:12 +0000 (13:50 +0100)] 
toaster: buildinfohelper Add handling local layers (i.e. non-git) layers

Adds handling of the non-git layers to create and update the
corresponding layer objects in Toaster.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: bldcontrol model BRLayer Add corresponding local_source_dir
Michael Wood [Mon, 8 Aug 2016 14:11:27 +0000 (15:11 +0100)] 
toaster: bldcontrol model BRLayer Add corresponding local_source_dir

Sync the BRLayer object with the new field added to the Layer object.
The BRLayer (BuildRequest Layers) are snapshots of the layers in the
project at build time and therefore need to mirror the required fields
of the layer object.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
9 years agotoaster: adapt xhr_import_layer test locally imported layer
Sujith H [Tue, 2 Aug 2016 15:56:17 +0000 (15:56 +0000)] 
toaster: adapt xhr_import_layer test locally imported layer

Update xhr_import_layer test to use locally imported
layer in local_source_dir.

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: update build configuration page
Sujith H [Mon, 1 Aug 2016 07:25:15 +0000 (07:25 +0000)] 
toaster: update build configuration page

Update layer branch and layer commit section
in the build configuration page for locally
imported layers. For locally imported layers
this secion goes as "Not applicable".

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: update recipe details page
Sujith H [Fri, 29 Jul 2016 10:42:30 +0000 (10:42 +0000)] 
toaster: update recipe details page

Update Layer branch and Layer commit
in recipe details page. For local layer
imported from toaster these fields are
not applicable.

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: update package detail page
Sujith H [Fri, 29 Jul 2016 07:15:24 +0000 (07:15 +0000)] 
toaster: update package detail page

Update package details pages layer branch
and layer commit section for locally imported
layers. We add Not applicable to them along
with a helper text, which helps user understand
why its not applicable to those layers.

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: updte build tables for locally imported layers
Sujith H [Fri, 29 Jul 2016 07:11:19 +0000 (07:11 +0000)] 
toaster: updte build tables for locally imported layers

Update the build tables section for locally
imported layers. Here we do not provide informations
such as branch or commit. Because those are locally
imported layer(s).

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: update the tables information
Sujith H [Fri, 29 Jul 2016 07:03:39 +0000 (07:03 +0000)] 
toaster: update the tables information

Update table informations for pages:
1) Compatible layers
2) Compatible image recipes
Added Not Applicable to the fields of locally
imported layers because they are not git version.

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: collect details for local dir imported from ui
Sujith H [Wed, 20 Jul 2016 08:58:57 +0000 (08:58 +0000)] 
toaster: collect details for local dir imported from ui

Collect the dir path imported from UI and make
sure that its getting added to bblayers.conf.
This patch exactly does the same job. Any layer
which is imported locally need not be cloned
again to _toaster_clones dir.

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: add local_source_dir field to model
Sujith H [Wed, 20 Jul 2016 08:57:11 +0000 (08:57 +0000)] 
toaster: add local_source_dir field to model

Add a new field local_source_dir to model.
This will clearly differentiate us from the
vcs_url which is for git path.
Adding migration file 0010_layer_local_source_dir_path.py
along with this patch.

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: add local directory to the db
Sujith H [Tue, 26 Jul 2016 09:38:17 +0000 (09:38 +0000)] 
toaster: add local directory to the db

Adding local directory to the database.
The local directory is added to vcs_url,
field of db.

[YOCO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: improve the display when local dir is added
Sujith H [Tue, 19 Jul 2016 07:57:09 +0000 (07:57 +0000)] 
toaster: improve the display when local dir is added

The helper text gets displayed accordingly when mouse
is hovered above the layers. If its a local directory
then no more branch is mentioned. Only directory path
is mentioned.

[YOCTO #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: update css file for layer import
Belen Barros Pena [Tue, 26 Jul 2016 08:08:42 +0000 (08:08 +0000)] 
toaster: update css file for layer import

Update the css file for the layer import.
This changes will improve the UI for the
task.

[YOCO #9911]

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
9 years agotoaster: add local_source_dir to the needed_fields
Sujith H [Wed, 27 Jul 2016 06:16:29 +0000 (06:16 +0000)] 
toaster: add local_source_dir to the needed_fields

This change will help us know if local_source_dir
is null or if there is value associated with this
field. This change will help us display the details
for duplicate layers tryied to import locally.

[YOCOT #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: control the selection of git and local repo
Sujith H [Tue, 19 Jul 2016 07:54:49 +0000 (07:54 +0000)] 
toaster: control the selection of git and local repo

Changes made in this patch will help user to select
either repo based on git and local. This patch also
improves the help provided to user so that user can
understand them and take necessary action to proceed.

[YOCOT #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: add import of local directory to UI
Sujith H [Tue, 19 Jul 2016 07:51:50 +0000 (07:51 +0000)] 
toaster: add import of local directory to UI

This patch will help to add local directory
to UI. The modification is made in importlayer.html
file. The radio buttons are created to separate
selection of git based repo and local directory.

Co-Author: Belen Barros Pena <belen.barros.pena@linux.intel.com>

[YOCOT #9911]

Signed-off-by: Sujith H <sujith.h@gmail.com>
9 years agotoaster: fix unhandled exception
Ed Bartosh [Wed, 27 Jul 2016 12:15:02 +0000 (15:15 +0300)] 
toaster: fix unhandled exception

manage.py lsupdates throws DataError exception if the recipe can't be
saved to the MySQL database:
    django.db.utils.DataError: (1406, "Data too long for column 'license' at row 1"

Adding DataError exception to the list of exceptions should make
lsupdates to print a warning message and skip the recipe.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
9 years agotoasterui: ensure that the Build object is always available
Elliot Smith [Thu, 4 Aug 2016 15:32:33 +0000 (16:32 +0100)] 
toasterui: ensure that the Build object is always available

Many of the methods in toasterui and buildinfohelper rely
on the internal state of the buildinfohelper; in particular, they
need a Build object to have been created on the buildinfohelper.

If the creation of this Build object is tied to an event which
may or may not occur, there's no guarantee that it will exist.
This then causes assertion errors in those methods.

To prevent this from happening, add an _ensure_build() method
to buildinfohelper. This ensures that a minimal Build object
is always available whenever it is needed, either by retrieving
it from the BuildRequest or creating it; it also ensures that
the Build object is up to date with whatever data is available
on the bitbake server (DISTRO, MACHINE etc.).

This method is then called by any other method which relies on
a Build object being in the internal state, ensuring that the
object is either available, or creating it.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster-tests: add test for showing self-dependent task
Elliot Smith [Fri, 29 Jul 2016 11:19:18 +0000 (12:19 +0100)] 
toaster-tests: add test for showing self-dependent task

Toaster occasionally records a task which depends on itself.

Add a test which checks that a task which depends on itself
can be displayed in the task page.

[YOCTO #9952]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: prevent infinite loop when finding task dependencies
Elliot Smith [Fri, 29 Jul 2016 11:25:46 +0000 (12:25 +0100)] 
toaster: prevent infinite loop when finding task dependencies

Toaster occasionally records a task which depends on itself.
This causes a problem when trying to display that task if it
is "covered" by itself, as the code does the following: for
task A, find a task B which covers A; then, recursively
find the task which covers B etc. If B == A, this loop becomes
infinite and never terminates.

To prevent this, add the condition that, when finding a task B
which covers A, don't allow B == A.

[YOCTO #9952]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster-tests: add tests for reverting to default sort
Elliot Smith [Tue, 19 Jul 2016 13:47:12 +0000 (14:47 +0100)] 
toaster-tests: add tests for reverting to default sort

Add tests for ToasterTable UI table sort reverting, which can
only be exercised via the browser.

Check that if a table is sorted by a column, and that column
is hidden, then the sort reverts to the default for the table.

[YOCTO #9836]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: reset table to default orderby when orderby column is hidden
Elliot Smith [Mon, 18 Jul 2016 15:02:14 +0000 (16:02 +0100)] 
toaster: reset table to default orderby when orderby column is hidden

When a ToasterTable is sorted by a column, and that column is
hidden from view, the sort doesn't revert to the default for the
table.

Modify the JS responsible for reloading the table data so that
it doesn't rely on clicking a table column heading (as this is
inflexible and error-prone). Instead, use a function to apply
the sort to the table; and call that function when column
headings are clicked.

This means that the ordering can be changed programmatically
to a specified default ordering when a column is hidden, without
having to click on a column heading.

Use this function when the current sort column is hidden, to
apply the default sort for the table.

[YOCTO #9836]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: show loading spinner after creating custom image
Elliot Smith [Fri, 15 Jul 2016 14:20:36 +0000 (15:20 +0100)] 
toaster: show loading spinner after creating custom image

Creating a custom image through the "New custom image" dialog
can sometimes result in a long pause between pressing the button
to create the image, and being transferred to the page showing
details of its content. This can make it appear as though pressing
the button had no effect.

To prevent this from happening, disable the button and text box
in the new custom image dialog after the "Create image" button is
pressed. Also show a loading spinner and "loading..." text on
the button to make it clear that the application is still responding.

[YOCTO #9475]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster-tests: fix erroneous message when test fails
Elliot Smith [Fri, 15 Jul 2016 11:09:57 +0000 (12:09 +0100)] 
toaster-tests: fix erroneous message when test fails

When one of the layer details tests fails (as it occasionally
does, if running on a machine under heavy load, due to sync issues),
the error message shown is misleading, as it is something like:

"Expected 'This was imported' in ['This was imported', ...]"

The string 'This was imported' is in the list shown in the message,
but the message suggests it isn't.

This is because the test compares the string with one list, but
then uses a different list in the fail message if the comparison
fails.

Fix the list shown in the message about the test failing.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster-tests: add tests for most recent builds state changes
Elliot Smith [Thu, 14 Jul 2016 14:58:00 +0000 (15:58 +0100)] 
toaster-tests: add tests for most recent builds state changes

Add tests for the state transitions in the "most recent builds"
area of the all builds page.

[YOCTO #9631]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster-tests: add tests for build dashboard menu and summary visibility
Elliot Smith [Wed, 13 Jul 2016 14:12:53 +0000 (15:12 +0100)] 
toaster-tests: add tests for build dashboard menu and summary visibility

Test that the build dashboard only shows a menu and a build
summary area if a build has properly "started" (i.e. has at least
one Variable object associated with it).

[YOCTO #8443]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster-tests: add tests for build time links in the all builds page
Elliot Smith [Tue, 26 Apr 2016 15:32:11 +0000 (16:32 +0100)] 
toaster-tests: add tests for build time links in the all builds page

When a build fails, it shouldn't have links on its build time in the
recent builds area or in the all builds table.

[YOCTO #8443]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: adjust build dashboard for failed builds
Elliot Smith [Wed, 13 Jul 2016 13:42:31 +0000 (14:42 +0100)] 
toaster: adjust build dashboard for failed builds

Remove the side bar and build details modules for failed builds.

[YOCTO #8443]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: add started property to Build
Elliot Smith [Wed, 13 Jul 2016 13:39:47 +0000 (14:39 +0100)] 
toaster: add started property to Build

Add a property to the Build model which records whether
the BuildStarted event has occurred for the build.

The proxy for this event is the presence of variables recorded
against the Build: as the buildinfohelper only saves variables
when the BuildStarted event occurs (as the variables aren't
available on the bitbake server before that point), we can
tell whether BuildStarted has happened by counting Variable
objects on the Build.

This can then be used to determine whether a Build "properly"
started, enabling a different dashboard display (left-hand menu
hidden) if the build didn't record any useful information (e.g.
if it had a bad target).

[YOCTO #8443]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: remove links from time field on failed builds
Elliot Smith [Wed, 13 Jul 2016 10:37:01 +0000 (11:37 +0100)] 
toaster: remove links from time field on failed builds

Failed builds don't have any time data recorded for them,
so the time field in the builds table, the time shown
in the recent builds area, and the build time shown in
the build dashboard should not be links for failed builds.

[YOCTO #8443]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: tweak styling and typos in recent builds area
Elliot Smith [Tue, 12 Jul 2016 15:38:06 +0000 (16:38 +0100)] 
toaster: tweak styling and typos in recent builds area

Help icons need to have the Bootstrap tooltip() method called on
them so that the popups are correctly styled.

Ensure that the colour of the help/error/warning icons is correct,
depending on the build state.

Fix pluralisation of errors and warnings shown.

Add a div around the build state area so it's easy to pick up
where the state is going to display (e.g. in tests).

[YOCTO #9631]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: show "Tasks starting..." until the first task completes
Elliot Smith [Tue, 12 Jul 2016 15:14:42 +0000 (16:14 +0100)] 
toaster: show "Tasks starting..." until the first task completes

To prevent showing a "0% of tasks complete" message for a long time,
don't show the progress bar until the first task has finished.

While waiting for that first task, show a message about tasks
starting instead.

[YOCTO #9631]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: show progress of recipe parsing in recent builds area
Elliot Smith [Mon, 11 Jul 2016 13:47:06 +0000 (14:47 +0100)] 
toaster: show progress of recipe parsing in recent builds area

Modify buildinfohelper and toasterui so that they record the
recipe parse progress (from ParseProgress events in bitbake)
on the Build object.

Note that because the Build object is now created at the
point when ParseStarted occurs, it is necessary to set the
build name to the empty string initially (hence the migration).
The build name can be set when the build properly starts,
i.e. at the BuildStarted event.

Then use this additional data to determine whether a Build
is in a "Parsing" state, and report this in the JSON API.
This enables the most recent builds area to show the recipe
parse progress.

Add additional logic to update the progress bar if the progress
for a build object changes.

[YOCTO #9631]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
9 years agotoaster: move most recent builds templating to client
Elliot Smith [Wed, 29 Jun 2016 14:41:56 +0000 (15:41 +0100)] 
toaster: move most recent builds templating to client

The most recent builds area of the all builds and project builds
table needs to update as a build progresses. It also needs
additional functionality to show other states (e.g. recipe parsing,
queued) which again needs to update on the client side.

Rather than add to the existing mix of server-side templating
with client-side DOM updating, translate all of the server-side
templates to client-side ones (jsrender), and add logic which
updates the most recent builds area as the state of a build changes.

Add a JSON API for mostrecentbuilds, which returns the state of
all "recent" builds. Fetch this via Ajax from the build dashboard
(rather than fetching the ad hoc API as in the previous version).

Then, as new states for builds are fetched via Ajax, determine
whether the build state has changed completely, or whether the progress
has just updated. If the state completely changed, re-render the
template on the client side for that build. If only the progress
changed, just update the progress bar. (NB this fixes the
task progress bar so it works for the project builds and all builds
pages.)

In cases where the builds table needs to update as the result of
a build finishing, reload the whole page.

This work highlighted a variety of other issues, such as
build requests not being able to change state as necessary. This
was one part of the cause of the "cancelling build..." state
being fragile and disappearing entirely when the page refreshed.
The cancelling state now persists between page reloads, as the
logic for determining whether a build is cancelling is now on
the Build object itself.

Note that jsrender is redistributed as part of Toaster, so
a note was added to LICENSE to that effect.

[YOCTO #9631]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>