]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
9 years agoSignatureGenerator: add method for saving the file checksum cache
Markus Lehtonen [Tue, 26 Jan 2016 13:34:28 +0000 (15:34 +0200)] 
SignatureGenerator: add method for saving the file checksum cache

Extend the API in order to be able to write out the file checksum cache
onto disk. SignatureGeneratorBasic class now implements a method that
update the fetcher local files checksum cache with the task file
dependency checksums.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb/cache: drop some unused arguments
Markus Lehtonen [Tue, 26 Jan 2016 13:34:27 +0000 (15:34 +0200)] 
bb/cache: drop some unused arguments

Drop unused 'd' argument from the cache save methods, simplifying the
API.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoAllow Hob to run images on a custom simulator, other than qemu
Mirela Rabulea [Tue, 19 Jan 2016 14:31:38 +0000 (16:31 +0200)] 
Allow Hob to run images on a custom simulator, other than qemu

The current behavior of Hob is that there is a "Run Image" button which becomes visible only for qemu images.

My suggested change is:
- if an image is selected and it is qemu-compatible, let the "Run image" button be named "Run qemu image"
- if an image is selected and it is not qemu-compatible, let the same button show up with the name "Run custom image", and besides that, an option shows-up to allow the selection of the custom script (by default it points out to runqemu script) to be used for launching this custom image

Note: in case there is more than one toggled image (qemu runnable or deployable), when the user clicks the "Run custom image" button, a dialog will be presented, allowing to choose between any of the existing images.

[YOCTO #8940]

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobb.ui.knotty: prefix task messages with recipe/task
Christopher Larson [Fri, 12 Feb 2016 00:13:36 +0000 (17:13 -0700)] 
bb.ui.knotty: prefix task messages with recipe/task

An example prefix: `perl-5.22.1-r0 do_compile:`

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoMove bb.{debug,note,..} into their own logging domain
Christopher Larson [Fri, 12 Feb 2016 00:13:23 +0000 (17:13 -0700)] 
Move bb.{debug,note,..} into their own logging domain

This lets us filter and use -l to show messages from that source specifically.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Set exit failure code on runQueueTaskFailed events
Richard Purdie [Sun, 14 Feb 2016 23:09:49 +0000 (23:09 +0000)] 
knotty: Set exit failure code on runQueueTaskFailed events

If the worker segfaults, we may never see a TaskFailed event from it, only
a runQueueTaskFailed event. In this case, return_value isn't getting set
leading to an incorrect exit code from bitbake. Fix by setting return_value
in both places.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotaskdata: Fix traceback issue with missing provider
Richard Purdie [Sun, 14 Feb 2016 10:14:22 +0000 (10:14 +0000)] 
taskdata: Fix traceback issue with missing provider

If there is a missing provider and we're using "-k" mode alongside "-w",
we could get a traceback since there was no provider. Add tests to avoid this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Improve cache handling
Richard Purdie [Sun, 14 Feb 2016 09:11:24 +0000 (09:11 +0000)] 
cooker: Improve cache handling

We're seeing issues where the self test, which uses tinfoil doesn't
notice the changed contents of include files. The issue is
cached_statements in the parser being reused when the files have changed.

Whilst looking at this, I realised there were some other issues:

* We need to also invalidate the mtime cache when cooker restarts
* We should pass full filenames to the file invalidation code
* We should process cached_statements as part of inotify invalidation

With these fixes, the caching is more reliable for memory resident
bitbake too. It does raise some questions about cache validation and
lifecycles and indicates bitbake does need more work in the area,
preferably with the removal of the globals. This at least highlights
and works around some of the current issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoBump version post release to 1.29.0
Richard Purdie [Fri, 12 Feb 2016 13:42:37 +0000 (13:42 +0000)] 
Bump version post release to 1.29.0

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: gracefully shutdown parsers
Ed Bartosh [Thu, 11 Feb 2016 10:37:08 +0000 (12:37 +0200)] 
cooker: gracefully shutdown parsers

CookerParser.shutdown code doesn't do all required work to shutdown
parser processes. As a result bitbake hangs if interrupted during
parsing. Putting None into the parser_quit queue should fix this issue
as it makes parsers to quit main loop.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuildinfohelper: unset brbe variable when build finishes
Elliot Smith [Wed, 10 Feb 2016 18:34:10 +0000 (18:34 +0000)] 
buildinfohelper: unset brbe variable when build finishes

The brbe variable is set on the bitbake server when the Toaster
UI starts. This enables Toaster to associate events with the
correct build and build environment.

However, the brbe variable is also used when a build starts to
identify whether a new build needs to be created, or an existing
one looked up. This causes a bug for command-line builds which
happen after a Toaster-triggered build: because the brbe variable
is never unset on the server or the buildinfohelper, the new
command-line build events are treated as originating from the
previous build.

Ensure the brbe variable is reset when the buildinfohelper "closes"
a build, so that each build then either sets the brbe variable
(Toaster-triggered builds) or leaves it blank (command-line builds).

Also modify the localhostbecontroller so that the brbe variable
is not set on the server and not looked up from the server. This
ensures that it is only set when the triggerBuild() method is
called, and that it remains as None for command-line builds.

[YOCTO #9021]

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 agobuild: Improve python execution tracebacks
Richard Purdie [Tue, 9 Feb 2016 15:08:42 +0000 (15:08 +0000)] 
build: Improve python execution tracebacks

If something fails in a exec_func_python() the current stack trace shows
incorrect filenames and linenumbers. For example:

The stack trace of python calls that resulted in this exception/failure was:
File: '/media/build1/poky/meta/recipes-sato/images/core-image-sato.bb', lineno: 200, function: <module>
     0196:                chksum = bb.utils.sha256_file(fn)
     0197:                f.write('%s\t%s\n' % (chksum, os.path.relpath(fn, baseoutpath)))
     0198:
     0199:
 *** 0200:copy_buildsystem(d)
     0201:
File: '/media/build1/poky/meta/recipes-sato/images/core-image-sato.bb', lineno: 9, function: copy_buildsystem
     0005:IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear hwcodecs"
     0006:
     0007:LICENSE = "MIT"
     0008:
 *** 0009:inherit core-image
     0010:
     0011:IMAGE_INSTALL += "packagegroup-core-x11-sato-games"
File: '/usr/lib/python2.7/subprocess.py', lineno: 535, function: check_call
     0531:    The arguments are the same as for the Popen constructor.  Example:
     0532:
     0533:    check_call(["ls", "-l"])
     0534:    """
 *** 0535:    retcode = call(*popenargs, **kwargs)
     0536:    if retcode:
     0537:        cmd = kwargs.get("args")
     0538:        if cmd is None:
     0539:            cmd = popenargs[0]

The problem is the use of "FILE" to obtain the current filename. Instead,
we therefore inject the function being executed into the methodpool which
allows us to correct its linenumber and filename information. We can then
clearly mark the initial piece as autogenerated and the rest of the linenumber
and filename information should be correct. Afterwards the trace starts:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:copy_buildsystem(d)
     0003:
File: '/media/build1/poky/meta/classes/populate_sdk_ext.bbclass', lineno: 66, function: copy_buildsystem
     0062:    import glob
     0063:    import oe.copy_buildsystem
     0064:    import subprocess
     0065:
 *** 0066:    subprocess.check_call("foo")
     0067:
     0068:    oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT', True)
     0069:
     0070:    conf_bbpath = ''
File: '/usr/lib/python2.7/subprocess.py', lineno: 535, function: check_call
     0531:    The arguments are the same as for the Popen constructor.  Example:
     0532:
     0533:    check_call(["ls", "-l"])
     0534:    """
 *** 0535:    retcode = call(*popenargs, **kwargs)
     0536:    if retcode:
     0537:        cmd = kwargs.get("args")
     0538:        if cmd is None:
     0539:            cmd = popenargs[0]

We can't inject into methodpool at parsing time, since there may be
_append or other override operations against the function before its
execution.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuild/data: Don't expand python functions before execution [API change]
Richard Purdie [Tue, 2 Feb 2016 14:07:58 +0000 (14:07 +0000)] 
build/data: Don't expand python functions before execution [API change]

Right now, if you have some python code like:

X = "a"

def somefunction(d):
    d.setVar("X", "b")
    d.setVar("Y", "${X}")

then any sane person would expect that Y = "b" at the end of the
function. This is not the case, Y = "a".

This is due to the python function being expanded before execution, the
executed code would read d.setVar("Y", "a"). This understandably
confuses people, it also makes it near impossible to write ${} in a
python function without unintended things happening.

I think there is general agreement we should fix this and standardise
on non-expansion of python functions. We already don't expand anonymous
python (mostly).

I've checked OE-Core with buildhistory before and after this change and
there were a small number of issues this exposed which I've sent
patches for.

I propose we default to not expanding python code and then deal with
any consequences from that if/as/where identified. This will improve
new user understanding and usability of the system, it also allows
several long standing weird expansion issues to be fixed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Don't expand python functions in variable dumps
Richard Purdie [Tue, 2 Feb 2016 13:59:52 +0000 (13:59 +0000)] 
cooker: Don't expand python functions in variable dumps

We don't want to expand python functions since they aren't expanded
at execution time (e.g. anonymous python). They can also have side
effects.

This function is primarily used by toaster for variable dumps for later
display. The lack of expansion of python functions won't matter in this case
and actively helps some variable handling (e.g. SRCPV).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata: Don't expand python functions for variable dependencies
Richard Purdie [Tue, 2 Feb 2016 13:58:17 +0000 (13:58 +0000)] 
data: Don't expand python functions for variable dependencies

Expanding python functions for variable dependencies doesn't really make sense,
not least since this causes execution of any inline python, it also makes it
impossible to write expressions like d.expand("${X}") of d.setVar("X", "${Y}")
which may have the wrong values if expanded now.

This starts to standardise the approach across bitbake for handling python code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata_smart: Avoid expanding anonymous python functions
Richard Purdie [Tue, 2 Feb 2016 13:55:08 +0000 (13:55 +0000)] 
data_smart: Avoid expanding anonymous python functions

We don't expand anonymous python before execution, so nor should
we do this when calculating checksums for them.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: models Remove manual transaction control from lsupdates
Michael Wood [Wed, 10 Feb 2016 11:51:44 +0000 (11:51 +0000)] 
toaster: models Remove manual transaction control from lsupdates

Revert "toaster: models.py do not use transactions".
This reverts commit e248a503ba84658dea086e65e9cde8b845b9c0ed
(Bitbake rev: 48d0d510816346073f135bb86fb7904fdb50bb27)

Manually managing the database transactions caused more
problems than it temporarily solved so we return control back to
Django's orm.

[YOCTO #8796]

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: build section Improve display of builds when > 1 targets
Belen Barros Pena [Wed, 10 Feb 2016 00:05:07 +0000 (00:05 +0000)] 
toaster: build section Improve display of builds when > 1 targets

* Display always the first target in alphabetical order to match what we
do in the breadcrumbs and the build dashboard heading

* Remove the extra space between the '+' and the additional number of
targets

* Make sure the tooltip with the full target list takes the Bootstrap
tooltip styles

* Replace the word 'targets' in the tooltip with 'recipes', since that's
how we call build targets everywhere else in Toaster

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: templates make build data breadcrumb consistent
Belen Barros Pena [Wed, 10 Feb 2016 00:05:06 +0000 (00:05 +0000)] 
toaster: templates make build data breadcrumb consistent

The pages in the build data section of Toaster showed different
breadcrumbs: in some pages the machine was displayed, but not in others.
For builds with more than one target, some pages showed the first
alphabetical target (the correct behaviour), others didn't.

This patch removes the inconsistencies, showing exactly the same
breacrumb across all pages in the section.

The patch also removes the extra space between the '+' and the number of
targets when the builds have more than one target.

Remove an unneeded debug message

Signed-off-by: Belen Barros Pena <belen.barros.pena@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoBBHandler/ast: Merge handMethod and handleMethodFlags
Richard Purdie [Tue, 9 Feb 2016 15:10:56 +0000 (15:10 +0000)] 
BBHandler/ast: Merge handMethod and handleMethodFlags

The functionality overlap between these two functions is significant and
its clearer to handle both things together since they are intimately
linked. There should be no behaviour change, just clearer code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoutils: Drop datastore function inspection during exception
Richard Purdie [Tue, 9 Feb 2016 15:09:45 +0000 (15:09 +0000)] 
utils: Drop datastore function inspection during exception

When we use functions from the data store, they now have correct line number
and filename information. This function would attempt to correct line numbers
which doesn't need correcting, leading to misleading messages to the user.
Therefore remove this code as being obsoleted.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: extended dot styling
Schroeder, Henning [Mon, 8 Feb 2016 15:07:14 +0000 (15:07 +0000)] 
cooker: extended dot styling

Extended the dot styling of dependencies created by bitbake -g in dot syntax to differentiate between the various kinds.
  depends: solid
  rdepends: dashed
  rrecommends: dotted

The change observed is that depends get an explicit style which is the same as dot default behavior and the runtime recommends get
dotted while before they were dashed. This helps to distinguish them graphically as well as eases post processing by script.

Signed-off-by: Henning Schroeder <henning.schroeder@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Enable Image Customisation feature
Michael Wood [Mon, 8 Feb 2016 17:41:24 +0000 (17:41 +0000)] 
toaster: Enable Image Customisation feature

Remove environment variable to toggle Image customisation feature

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: xhr_customrecipe_packages Add dependencies to included packages
Michael Wood [Fri, 5 Feb 2016 12:38:21 +0000 (12:38 +0000)] 
toaster: xhr_customrecipe_packages Add dependencies to included packages

Add the dependencies of packages which are added to the
CustomImageRecipe. Currently just handle the first tier of dependencies
as this is what we show in the UI.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm generate_recipe_content only exclude locale packages
Michael Wood [Fri, 5 Feb 2016 12:37:08 +0000 (12:37 +0000)] 
toaster: orm generate_recipe_content only exclude locale packages

Allow package groups in our custom image recipe. Excluding them creates
more undefined behaviour than including them at this stage. Also update
to use convenience method for returning all packages.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: customrecipe page Add last successful build link and conditionals
Michael Wood [Fri, 5 Feb 2016 12:32:54 +0000 (12:32 +0000)] 
toaster: customrecipe page Add last successful build link and conditionals

Add link to the last successful build if there is one and add
conditionals for the ancillary recipe metadata.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: models Add update_package_list for CustomImageRecipe
Michael Wood [Fri, 5 Feb 2016 11:59:17 +0000 (11:59 +0000)] 
toaster: models Add update_package_list for CustomImageRecipe

Add a method to update the packages included list from the last
build, this effectively "synchronises" the package list from what
we think will happen at the Customise image stage with what
actually was produced with a build. It's not ideal to have this
function here but we also need to make sure that no race condition
of the user accessing this list and it being updated occurs.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm Add last_updated field to CustomImageRecipe
Michael Wood [Fri, 5 Feb 2016 11:44:57 +0000 (11:44 +0000)] 
toaster: orm Add last_updated field to CustomImageRecipe

Field to keep track of when the package list for the CustomImageRecipe
was last updated from a build.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: models add get_last_successful_built_target method
Michael Wood [Fri, 5 Feb 2016 11:41:43 +0000 (11:41 +0000)] 
toaster: models add get_last_successful_built_target method

Add a convenience method to get the last successful build
target for a CustomImageRecipe.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: pkg_dependencies_popover just show direct dependencies
Michael Wood [Fri, 5 Feb 2016 11:25:34 +0000 (11:25 +0000)] 
toaster: pkg_dependencies_popover just show direct dependencies

In the dependencies popover just show direct dependency in the list
rather than recommends, conflicts etc

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: models add all_depends method for Package_DependencyManager
Michael Wood [Fri, 5 Feb 2016 11:18:09 +0000 (11:18 +0000)] 
toaster: models add all_depends method for Package_DependencyManager

This convenience method returns just the Package_Dependency for
the package which are regular dependencies i.e. not RECOMMENDS or
any other types.
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: buildinfohelper CustomImagePackage update dependency info
Michael Wood [Fri, 5 Feb 2016 11:13:46 +0000 (11:13 +0000)] 
toaster: buildinfohelper CustomImagePackage update dependency info

Instead of keeping the original dependency information for the pool of
CustomImagePackage reset it with each new build.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: newcustomimage_modal add frontend name validation
Michael Wood [Tue, 2 Feb 2016 17:46:31 +0000 (17:46 +0000)] 
toaster: newcustomimage_modal add frontend name validation

Add front end handling of validation response from create new
CustomImageRecipe api.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: API CustomImageRecipe check the recipe name supplied is valid
Michael Wood [Tue, 2 Feb 2016 17:44:01 +0000 (17:44 +0000)] 
toaster: API CustomImageRecipe check the recipe name supplied is valid

Check that the name for a new CustomImageRecipe doesn't already exist in
the project or in the database of existing recipes (e.g. from the layer
index). Also restrict the characters entered for the recipe naming
convention.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: views CustomRecipe API add size information to the package lists
Michael Wood [Fri, 29 Jan 2016 14:43:25 +0000 (14:43 +0000)] 
toaster: views CustomRecipe API add size information to the package lists

Add the file size of the packages and the total to the JSON response.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: models Invalidate ToasterTables cache when a m2m field changes
Michael Wood [Fri, 29 Jan 2016 14:40:41 +0000 (14:40 +0000)] 
toaster: models Invalidate ToasterTables cache when a m2m field changes

Whem a m2m field changes we need to clear the ToasterTables cache as
this can affect the state of items in ToasterTables.
For example the CustomImagePackages being added or removed from a custom
image recipe.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: customrecipe Add dependency tracking to package selection
Michael Wood [Fri, 29 Jan 2016 14:38:43 +0000 (14:38 +0000)] 
toaster: customrecipe Add dependency tracking to package selection

Update the states of the packages in the package selection UI to reflect
whether it's likely that 1st level dependencies for the package will be
also added.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: tables move template logic into the pkg_add_rm_btn
Michael Wood [Thu, 28 Jan 2016 18:05:14 +0000 (18:05 +0000)] 
toaster: tables move template logic into the pkg_add_rm_btn

Instead of defining this as a string it's sufficiently large enough to
warrant its own file.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: CustomImageRecipe generate overwrite IMAGE_FEATURES
Michael Wood [Thu, 28 Jan 2016 18:01:39 +0000 (18:01 +0000)] 
toaster: CustomImageRecipe generate overwrite IMAGE_FEATURES

If we're breaking up an image recipe's packages we will also need to
override IMAGE_FEATURES to make sure the customisation is not altered

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: make locale packages uneditable in custom image page
Elliot Smith [Thu, 21 Jan 2016 17:11:11 +0000 (17:11 +0000)] 
toaster: make locale packages uneditable in custom image page

When the packages associated with a custom image recipe are
shown in the customrecipe editing page, locale packages are
shown in the same way as all other packages. This gives the false
impression that these packages can be removed, when in fact
they are automatically added due to the IMAGE_LINGUAS build
variable.

Modify the customrecipe page so that locale packages cannot be
removed, and provide some help text explaining why.

[YOCTO #8927]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: include locale and packagegroup packages in custom image
Elliot Smith [Wed, 20 Jan 2016 13:06:00 +0000 (13:06 +0000)] 
toaster: include locale and packagegroup packages in custom image

The custom image editing page doesn't show locale and packagegroup
packages: they are filtered out of the queryset used to populate
the ToasterTable.

Rather than filtering these packages out, include them in the list
of packages which are shown.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: update custom image package table filters
Elliot Smith [Mon, 18 Jan 2016 14:51:54 +0000 (14:51 +0000)] 
toaster: update custom image package table filters

The custom image package selection filters were using the old
ToasterTable filter approach, which caused the table filter to fail.

Amend the table to use the new ToasterTable filtering API to fix
this.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: move recent builds query to model
Elliot Smith [Mon, 18 Jan 2016 14:23:55 +0000 (14:23 +0000)] 
toaster: move recent builds query to model

The progress updater for the recent builds section makes a JSON
call to the project view URL to get progress for each build.
However, conversion of the builds pages to ToasterTable broke this,
as the JSON response no longer contained the data necessary to
populate the progress bars.

Move the recent builds query to the Build model, so that it is
accessible to the ToasterTables using it ("project builds" and
"all builds"), as well as to the "project" view.

Modify the code in the recent builds template to use the slightly
different objects returned by the recent builds query on Build.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: update customimagerecipe migration
Elliot Smith [Mon, 18 Jan 2016 10:55:16 +0000 (10:55 +0000)] 
toaster: update customimagerecipe migration

When applying migrations, Django shows this warning:

"Your models have changes that are not yet reflected in a migration,
and so won't be applied."

This is because the customimagerecipe model has changed, but those
changes are not covered by a migration.

Add the missing migration to clear this warning.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: add merge migration to resolve conflict
Elliot Smith [Mon, 18 Jan 2016 10:28:39 +0000 (10:28 +0000)] 
toaster: add merge migration to resolve conflict

Django detects a conflict between a migration added to support
image customisation and another migration which supports PROVIDES.

Add a merge migration to resolve the conflict (as suggested by
Django).

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm generate_recipe_file_contents Handler for require recipe
Michael Wood [Wed, 27 Jan 2016 12:44:54 +0000 (12:44 +0000)] 
toaster: orm generate_recipe_file_contents Handler for require recipe

Add a special case for when the recipe we have based a custom image
recipe on requires another recipe.
In this case we need to adjust the file location to be able to
require
the recipe when we're in the toaster-custom-images layer.

For example:
"require core-image-minimal.bb" is changed to:
"require recipes-core/images/core-image-minimal.bb"

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: project builds Poll the server to get latest progress for build
Michael Wood [Wed, 16 Dec 2015 11:36:39 +0000 (11:36 +0000)] 
toaster: project builds Poll the server to get latest progress for build

Poll the server for the project build progress value. This is something
that will need to be re-done once we have a proper API for this on the
server side.

[YOCTO 8328]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: localhostbectrl Update the dirpath of customrecipe's base layer
Michael Wood [Mon, 14 Dec 2015 18:45:02 +0000 (18:45 +0000)] 
toaster: localhostbectrl Update the dirpath of customrecipe's base layer

We need to know the location of the based_on recipe's layer on the
file system before we try and generate the custom image recipe. As
we read the recipe to make the custom version.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: tables Check layer presence in project for customise_btn
Michael Wood [Thu, 10 Dec 2015 14:52:22 +0000 (14:52 +0000)] 
toaster: tables Check layer presence in project for customise_btn

Make sure we send the current list of layers to the customise button to
be able to know whether it should be set as an add layer button or a
customise button on the New custom image page.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: toastergui tests Add addtional data to the setUp for new tables
Michael Wood [Tue, 8 Dec 2015 19:56:11 +0000 (19:56 +0000)] 
toaster: toastergui tests Add addtional data to the setUp for new tables

Add additional data to the setUp to be able to test all the tables for
Image Customisation. Also add the name of the table being tested to the
num of rows assertion.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: tables SelectPackagesTable rename recipe_id to custrecipeid
Michael Wood [Tue, 8 Dec 2015 19:52:42 +0000 (19:52 +0000)] 
toaster: tables SelectPackagesTable rename recipe_id to custrecipeid

Rename the recipe_id to custrecipeid to avoid confusion about which type
of object we're going to be accessing. This means that in the unit tests
for tables we can pass a different kwargs for custom recipes vs normal
recipes.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: toastergui tests Update package test to use CustomImagePackage
Michael Wood [Tue, 8 Dec 2015 16:07:02 +0000 (16:07 +0000)] 
toaster: toastergui tests Update package test to use CustomImagePackage

Update test for adding and removing a package from a CustomImageRecipe
so that it uses the CustomImagePackage and correct fields for the packages
included. Change the test for error condition to use an invalid package
id as ManyToMany remove() on package that isn't in the relationship does
not throw an error.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: customrecipe Add further front end features using new API
Michael Wood [Mon, 7 Dec 2015 18:42:16 +0000 (18:42 +0000)] 
toaster: customrecipe Add further front end features using new API

This adds some basic package dependency hint modals when you add and
remove a package. It also makes sure that if the CustomImageRecipe has
no current included packages that we go and check this with the server
to see if a relevant build has taken place which will provide this
information.

[YOCTO #8082]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: xhr_customrecipe_packages add GET info for package response
Michael Wood [Tue, 8 Dec 2015 16:28:04 +0000 (16:28 +0000)] 
toaster: xhr_customrecipe_packages add GET info for package response

Add response for GET to the xhr_customrecipe_packages ReST API

/xhr_customrecipe/<recipe_id>/packages/<package_id>
Thie response includes the id, name, version and dependency information
for the package.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: xhr_customrecipe_id change to use CustomImagePackage
Michael Wood [Tue, 8 Dec 2015 16:25:49 +0000 (16:25 +0000)] 
toaster: xhr_customrecipe_id change to use CustomImagePackage

Instead of doing a shallow copy of the package into the
CustomImageRecipe when we add packages we can now use the
CustomImagePackage as a M2M field on the Package to CustomImageRecipe.
Also switch to using Target_Installed_Package as the method to retrieve
the package list from the build.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: API allow CustomImageRecipe to be updated after creation
Michael Wood [Tue, 8 Dec 2015 11:36:17 +0000 (11:36 +0000)] 
toaster: API allow CustomImageRecipe to be updated after creation

When we create a CustomImageRecipe we create a Layer_Version and
Recipe for that Recipe to be in, we only need one Layer_Version for our
Recipes so if that Layer_Version is updated by building it we need
a slightly more custom version of get_or_create to take into account the
fields which we expect can change but still mean that the object we want is
valid and doesn't need to be created.

In the Recipe case this is when we're updating an existing
CustomImageRecipe as we allow people to create a recipe even when the
based on recipe hasn't been built so we need to update it once a build
has happened.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: tables Change SelectPackagesTable to use ProjectPackage
Michael Wood [Tue, 8 Dec 2015 11:29:23 +0000 (11:29 +0000)] 
toaster: tables Change SelectPackagesTable to use ProjectPackage

This changes the SelectPackagesTable to use the ProjectPackage table
instead of very large expensive queries to retrieve a list of currently
available packages for the project.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: tables add recipe download link to CustomImagesTable
Michael Wood [Mon, 7 Dec 2015 18:46:14 +0000 (18:46 +0000)] 
toaster: tables add recipe download link to CustomImagesTable

Add the download recipe link and fix the package count field.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: newcustomimage_modal use libtoaster method for new CustomRecipe
Michael Wood [Mon, 7 Dec 2015 18:44:37 +0000 (18:44 +0000)] 
toaster: newcustomimage_modal use libtoaster method for new CustomRecipe

Use libtoaster.createCustomRecipe rather than own implementation of this
function.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: libtoaster Add createCustomRecipe method
Michael Wood [Mon, 7 Dec 2015 18:43:15 +0000 (18:43 +0000)] 
toaster: libtoaster Add createCustomRecipe method

This adds the function to call the ReSt API to create a custom image
recipe.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm Add convenience method to get all pkgs in a CustomImageRecipe
Michael Wood [Mon, 7 Dec 2015 18:23:32 +0000 (18:23 +0000)] 
toaster: orm Add convenience method to get all pkgs in a CustomImageRecipe

Returns a queryset of the all the packages that we expect to have in a
CustomImageRecipe.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm get_project_layer_versions to return layer_version objects
Michael Wood [Mon, 7 Dec 2015 18:15:43 +0000 (18:15 +0000)] 
toaster: orm get_project_layer_versions to return layer_version objects

Instead of returning layercommits return the actual Layer_Version objects
for the layercommit as these are the useful objects which contain the
metadata.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: toastergui tests Add unit test for download custom recipe
Michael Wood [Thu, 5 Nov 2015 15:38:24 +0000 (15:38 +0000)] 
toaster: toastergui tests Add unit test for download custom recipe

Add unit test to test downloading end point and the basic content of the
custom recipe that is generated.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: toastergui tests Update to reflect changes to CustomImageRecipe
Michael Wood [Thu, 5 Nov 2015 12:33:35 +0000 (12:33 +0000)] 
toaster: toastergui tests Update to reflect changes to CustomImageRecipe

Now that CustomImageRecipe inherits from Recipe make sure that the
accessors and the required values for Recipe are now setup correctly.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: views xhr_customrecipe_packages clean up API
Michael Wood [Thu, 5 Nov 2015 12:30:40 +0000 (12:30 +0000)] 
toaster: views xhr_customrecipe_packages clean up API

- Fix generic variable names such as "object" and "values" when not
  needed.
- Use try catch instead of a queryset filter to return the custom recipe
  object
- Be explicit about the fields returned for the custom recipe info field
- Remove redundant new_package field

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: toastertable remove title from Show all in table
Michael Wood [Wed, 4 Nov 2015 15:50:44 +0000 (15:50 +0000)] 
toaster: toastertable remove title from Show all in table

Title is often very long so this is not a great property to use here.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: Add recipe details page
Michael Wood [Wed, 4 Nov 2015 15:46:24 +0000 (15:46 +0000)] 
toaster: Add recipe details page

This page provides the details of recipes, showing their packages and
additional metadata. It also allows you to build the recipe or customise
the recipe if it is an image recipe.

[YOCTO #8070]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: newcustomimage Move modal dialog out of newcustomimage template
Michael Wood [Wed, 4 Nov 2015 15:44:00 +0000 (15:44 +0000)] 
toaster: newcustomimage Move modal dialog out of newcustomimage template

Move the modal template and JS out of the newcustomimage page so that it
can also be used by the image details page.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: Continue front end features to custom image recipe page.
Michael Wood [Wed, 4 Nov 2015 15:37:19 +0000 (15:37 +0000)] 
toaster: Continue front end features to custom image recipe page.

Continuation of the work on the custom image recipe page, this brings
in:

- Basic notification of having added/removed a package.
- Connect up Build button
- Download recipe feature
- No packages states
- Project bread crumb
- Display additional recipe metadata
- Update accessors for recipe object inheritance changes

[YOCTO #8082]

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: tables Add table for Packages and update SelectPackagesTable
Michael Wood [Wed, 4 Nov 2015 15:17:45 +0000 (15:17 +0000)] 
toaster: tables Add table for Packages and update SelectPackagesTable

Create a Packages table for use as the image details page.
Change the SelectPackagesTable table to inherit from the Packages table.
Remove the need for a separate view by adding the additional template
context items to the Table's page context.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: views Add view to download custom recipe
Michael Wood [Wed, 4 Nov 2015 15:14:06 +0000 (15:14 +0000)] 
toaster: views Add view to download custom recipe

View to provide the custom recipe download feature. The recipe is
generated on-demand to make sure that it is the most current version of
the Custom recipe.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: move CustomImageRecipe generation to API entry point
Michael Wood [Wed, 4 Nov 2015 15:02:28 +0000 (15:02 +0000)] 
toaster: move CustomImageRecipe generation to API entry point

Use the CustomImageRecipe generate_recipe_file_contents to generate the
recipe that we build from. Move creation of the dummy layer and recipe
object to the point of recipe creation as we need these objects before
the build time. Also update the methods to add and remove packages to
account for the CustomImageRecipe inheriting from Recipe.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm add CustomImageRecipe generate contents function
Michael Wood [Wed, 4 Nov 2015 14:56:36 +0000 (14:56 +0000)] 
toaster: orm add CustomImageRecipe generate contents function

Add function generate_recipe_file_contents to dump the custom image
recipe instance to a string for use either to push to the user as a
downloaded version of their custom image recipe or to use to generate
the recipe that we build.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: buildinfohelper Add the concept of CustomImagePackage
Michael Wood [Mon, 7 Dec 2015 18:26:47 +0000 (18:26 +0000)] 
toaster: buildinfohelper Add the concept of CustomImagePackage

This adds the concept of CustomImagePackage this is similar to the way
layers and recipes work in that we have a set of data which is part of
the build history and a set of data which is part of the configuration
data that toaster uses to guide people in configuring their project. We
create a set of  built_packages for every build but only create a package
for configuration purposes if we don't already have one, so that the
CustomImagePackage only ever contains a unique list of packages that are
available to be added and removed from a CustomImageRecipe.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm: Add db migration for new CustomImagePackage table
Michael Wood [Tue, 8 Dec 2015 21:01:10 +0000 (21:01 +0000)] 
toaster: orm: Add db migration for new CustomImagePackage table

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm Add CustomImagePackage table
Michael Wood [Mon, 7 Dec 2015 18:22:08 +0000 (18:22 +0000)] 
toaster: orm Add CustomImagePackage table

This table is used to track all the available packages in the current
toaster. Many of these packages belong to many CustomImageRecipes.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm: Add db migration for new CustomImageRecipe inheritance change
Michael Wood [Tue, 8 Dec 2015 20:58:55 +0000 (20:58 +0000)] 
toaster: orm: Add db migration for new CustomImageRecipe inheritance change

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm make CustomImageRecipe inherit from Recipe
Michael Wood [Wed, 4 Nov 2015 14:54:41 +0000 (14:54 +0000)] 
toaster: orm make CustomImageRecipe inherit from Recipe

This allows us to re-use the properties of a recipe for the custom image
recipes as well as re-using the existing templates and logic that deals
with recipe objects.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: orm Add sum of dependencies size function to PackageDependencyManager
Michael Wood [Wed, 4 Nov 2015 14:48:54 +0000 (14:48 +0000)] 
toaster: orm Add sum of dependencies size function to PackageDependencyManager

Add function that returns the Sum of the size of all the packages which depend on a package.
Access get_total_source_deps_size via a packages's dependency
manager.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: tablejs Add an event handler to manually trigger a data reload
Michael Wood [Tue, 27 Oct 2015 19:11:01 +0000 (19:11 +0000)] 
toaster: tablejs Add an event handler to manually trigger a data reload

Allow users of ToasterTable to manually trigger a refresh of the data.
This can be useful if an action has happened in-page and the data is now
invalid. Such as new data being added or removed from the model.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: ToasterTables simplify filter function move common part to widget
Michael Wood [Tue, 27 Oct 2015 19:04:46 +0000 (19:04 +0000)] 
toaster: ToasterTables simplify filter function move common part to widget

Move part of the functionality of the filter functions to the Table
widget. We don't need to implement it in each subclass.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: models fall back to a sensible string for no vcs reference
Michael Wood [Fri, 23 Oct 2015 21:57:18 +0000 (22:57 +0100)] 
toaster: models fall back to a sensible string for no vcs reference

Fall back to a 'n/a' string for the vcs reference, not all our source
has to be in a vcs and therefore it is legitimate for this to be none.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agotoaster: localhostbecontroller CustomRecipe now base_recipe is Recipe
Michael Wood [Wed, 21 Oct 2015 13:16:45 +0000 (14:16 +0100)] 
toaster: localhostbecontroller CustomRecipe now base_recipe is Recipe

Update the reference to the base_recipe. It is now a Recipe object
rather than an intermediate AvailableRecipe object.
Therefore doesn't need an extra traverse down the object hierarchy.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
9 years agobb/fetch2: Move export_proxies function from wget to utils.
Aníbal Limón [Thu, 28 Jan 2016 22:27:52 +0000 (16:27 -0600)] 
bb/fetch2: Move export_proxies function from wget to utils.

In order to use in other modules since is a common function
when needs to get proxies working.

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>
9 years agotoaster: reinstate ID on edit columns button
Elliot Smith [Thu, 4 Feb 2016 09:26:20 +0000 (11:26 +0200)] 
toaster: reinstate ID on edit columns button

The ID was omitted from the "edit columns" button on the
"projects", "all builds" and "project builds" tables when they
were converted to ToasterTable. This caused the QA tests to fail.

Reinstate the ID so the tests can identify the "edit columns" button
correctly.

[YOCTO #9051]

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>
9 years agocooker: shutdown cooker parser on shutdown
Ed Bartosh [Thu, 4 Feb 2016 17:23:39 +0000 (19:23 +0200)] 
cooker: shutdown cooker parser on shutdown

Currently any not catched exception in cooker causes bitbake
to hang because of not terminated children of CookerParser.

Long term solution would be to reimplement Cooker as a context
manager and terminate parser children in its __exit__ method.

Partial fix is to call CookerParser.shutdown in Cooker.shutdown in
hope that all Cooker exceptions are caught and shutdown method is
called.

[YOCTO #8900]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/osc: Clean up old variable syntax
Richard Purdie [Thu, 4 Feb 2016 23:29:51 +0000 (23:29 +0000)] 
fetch2/osc: Clean up old variable syntax

Since people do copy and paste these things, clean up old syntax styles.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/osc: Remove hardcoded url
Richard Purdie [Thu, 4 Feb 2016 23:28:53 +0000 (23:28 +0000)] 
fetch2/osc: Remove hardcoded url

This shouldn't be in here, use a variable instead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoparse/ast: Mark anonymous functions as python functions
Richard Purdie [Tue, 2 Feb 2016 13:54:37 +0000 (13:54 +0000)] 
parse/ast: Mark anonymous functions as python functions

Anonymous functions are python functions, set the variable
flags as such so we can detect them and avoid expansion where
needed.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocodeparser: Improve handling of data.expand() dependencies
Richard Purdie [Tue, 2 Feb 2016 13:54:01 +0000 (13:54 +0000)] 
codeparser: Improve handling of data.expand() dependencies

Currently bitbake doesn't parse into data.expand() expressions,
relying on high level expansion of python code to handle this.

One of the tests does however test this works.

We don't really want to be doing string expansion on python code,
so specifically parse into expand() function calls so that when
the high level behaviour is tweaked, the self tests continue to
pass and that we do continue to handle expand() function calls as
best we can.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb: Add expansion parameter to getVarFlag
Richard Purdie [Tue, 2 Feb 2016 23:49:09 +0000 (23:49 +0000)] 
lib/bb: Add expansion parameter to getVarFlag

This sets the scene for removing the default False for expansion from
getVarFlag. This would later allow True to become the expand default.

On the most part this is an automatic translation with:

sed -e 's:\(\.getVarFlag([^,()]*, [^,()]*\)):\1, False):g'  -i `grep -ril getVar *`

There should be no functional change from this patch.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/gitsm: Fix when repository change submodules
Felipe F. Tonello [Wed, 3 Feb 2016 16:29:42 +0000 (16:29 +0000)] 
fetch2/gitsm: Fix when repository change submodules

This fix a problem when checking out a commit that changes the submodules
previously checkout.

Example:
Recipe uses branch A and then it updates to use branch B, but branch B has
different submodules dependencies then what branch A previously had.

Signed-off-by: Felipe F. Tonello <eu@felipetonello.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata_smart: Add missing expand parameter to getVar call
Richard Purdie [Tue, 2 Feb 2016 23:49:40 +0000 (23:49 +0000)] 
data_smart: Add missing expand parameter to getVar call

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: prserv: do not clear umask when daemonizing
Diego Santa Cruz [Tue, 2 Feb 2016 12:08:05 +0000 (13:08 +0100)] 
bitbake: prserv: do not clear umask when daemonizing

Clearing the umask when daemonizing is not the correct thing
to do, as it will create files writable by anyone by default.
For instance the pid file was being created with mode 777.
This could also potentially affect the sqlite database.
Better let the calling process decide on the umask.

[YOCTO #9036]

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: prserv: SIGTERM handling hung process
Diego Santa Cruz [Tue, 2 Feb 2016 12:05:50 +0000 (13:05 +0100)] 
bitbake: prserv: SIGTERM handling hung process

The current SIGTERM handler hungs the process instead of
making it exit. The problem seems to be that the handler thread
is not signaled to quit, so it stays there doing its work, as
it is not a daemon thread. Setting the quit variable fixes this.

While at it, to not use the SystemExit exception to terminate
upon SIGTERM but instead left the quit flag do its job. This way
the PID file is properly removed.

[YOCTO #9035]

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: prserv: -wal and -shm sqlite lost when daemonizing
Diego Santa Cruz [Tue, 2 Feb 2016 12:04:20 +0000 (13:04 +0100)] 
bitbake: prserv: -wal and -shm sqlite lost when daemonizing

When daemonizing the PR service the -wal and -shm sqlite files were
being deleted, although they should never be. While the daemonized
process keeps the file descriptors open and thus a clean exit does
not loose any data, a power outage would loose all data in the WAL.
Removing these files also breaks sqlite collaboration between
processes and furthermore prevents taking proper backups without
stopping the PR service.

The reason this happens is that the DB connection is opened in
the initial process, before forking for daemonization. When the
DB connection is closed by the exiting parent processes it can
delete the -wal and -shm files if it considers itself to be the
last connection to the DB. This is easily fixed by opening the
DB connection after all forking.

[YOCTO #9034]

Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker, bitbake-worker: Fix spelling of "received"
Phil Blundell [Sun, 31 Jan 2016 13:51:28 +0000 (13:51 +0000)] 
cooker, bitbake-worker: Fix spelling of "received"

I before E, except after C...

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Only start as many parse threads as we need
Richard Purdie [Sun, 31 Jan 2016 13:31:41 +0000 (13:31 +0000)] 
cooker: Only start as many parse threads as we need

If we're only going to parse one recipe, no point in starting
a large number of threads.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Don't show errors for universe provider issues
Richard Purdie [Sun, 31 Jan 2016 13:23:12 +0000 (13:23 +0000)] 
knotty: Don't show errors for universe provider issues

When running universe builds, we don't expect an error exit code for
provider warnings. Change the error messages to warnings in this case.

This deals with errors causing problems on our autobuilders amongst
other issues.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: BBUIHelper: Remove function findServerDetails
Sujith H [Tue, 5 Jan 2016 13:00:15 +0000 (18:30 +0530)] 
bitbake: BBUIHelper: Remove function findServerDetails

findServerDetails function can be removed safely
from the source tree. Couldn't find any files
calling this function.

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>