]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/log
thirdparty/openembedded/openembedded-core-contrib.git
9 years agofetch/git: Change to use clearer ssh url syntax for broken servers
Richard Purdie [Thu, 7 Jan 2016 13:18:52 +0000 (13:18 +0000)] 
fetch/git: Change to use clearer ssh url syntax for broken servers

Some servers, e.g. bitbucket.org can't cope with ssh:// as part of
the git url syntax. git itself is happy enough with this but you
get server side errors when using it.

This changes the git fetcher to use the more common ssh url format
which also means we need a : before the path.

Seems a shame to have to do this due to broken servers however
it should be safe enough since this other form is the one most people
use on the commandline so it should be safe enough.

[YOCTO #8864]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Use non-interactive mode as fallback for dumb terminals
Richard Purdie [Thu, 7 Jan 2016 13:18:20 +0000 (13:18 +0000)] 
knotty: Use non-interactive mode as fallback for dumb terminals

TERM=dumb bitbake X

shows no output for task status which is suboptimal. Use the non-interactive
mode if the terminal doesn't support what we need for interactive mode giving
a better user experience. Also print a note to the console to say this has
happened.

[YOCTO #8768]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: fix findFilesMatchingInDir documentation
Ross Burton [Fri, 18 Dec 2015 12:23:14 +0000 (12:23 +0000)] 
cooker: fix findFilesMatchingInDir documentation

The documentation for findFilesMatchingInDir() was inconsistant with the
implementation: the regex was escaped before searching so effectively it's a
pure textual substring, and the machine example was broken.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: use in instead of count
Ross Burton [Wed, 9 Dec 2015 11:49:46 +0000 (11:49 +0000)] 
cooker: use in instead of count

No point counting all instances when we just want to know if there's any or not.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoast: Add filename/lineno to mapped functions
Richard Purdie [Tue, 5 Jan 2016 23:01:25 +0000 (23:01 +0000)] 
ast: Add filename/lineno to mapped functions

Where we add in mappings for EXPORT_FUNCTIONS, add dummy filename
and lineno data so ensure the assumption that all python functions
have this is correct.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agomain: kill server without queue setup
Ed Bartosh [Tue, 5 Jan 2016 13:45:38 +0000 (15:45 +0200)] 
main: kill server without queue setup

Setup of event queue includes registering of UI handler.
This operation can fail when cooker is busy. However, there is
no need in registering UI handler for terminating the server.

Moved the call of connection.terminateServer before setting up
of the event queue. This should make terminating server to work
more reliably as it doesn't depend on setting up the event queue
and registering UI handler anymore.

This should also help Toaster backend to restart bitbake server
and observer without getting "Could not register UI event handler"
errors.

[YOCTO #8776]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoxmplrpc: split connect method
Ed Bartosh [Tue, 5 Jan 2016 13:45:37 +0000 (15:45 +0200)] 
xmplrpc: split connect method

Current code in connect method sets up event queue, which requires
registering UI handler. This functionality may not be needed for
some operations, e.g. for server termination.

Moved functionality of setting up event queue in from 'connect'
method to 'setupEventQueue' in BitBakeXMLRPCServerConnection class.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agouievent: refactor retry loop
Ed Bartosh [Mon, 4 Jan 2016 09:26:34 +0000 (11:26 +0200)] 
uievent: refactor retry loop

Replaced 'while' loop with 'for' loop.
Made the code more compact and hopefully more understandable.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agouievent: get rid of EventHandler attribute
Ed Bartosh [Thu, 31 Dec 2015 16:42:15 +0000 (18:42 +0200)] 
uievent: get rid of EventHandler attribute

This attribute was introduced by mistake. EventHandle is used in the
code for the same purpose.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agouievent: add error to registerEventHandler return
Ed Bartosh [Thu, 31 Dec 2015 16:42:14 +0000 (18:42 +0200)] 
uievent: add error to registerEventHandler return

Current code throws Exception("Could not register UI event handler")
if event handler can't be registered. The real reason of this is that
cooker is in busy state. Error message lacks information about this.

Added error message to the return value of registerEventHandler.
Included returned error message into the log message and exception
text.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: add state.get_name method
Ed Bartosh [Thu, 31 Dec 2015 16:42:13 +0000 (18:42 +0200)] 
cooker: add state.get_name method

Added method to convert state code into the human readable name.
It will be used in logging and error reporting.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/__init__.py: Add support for 7-Zip
Juro Bystricky [Mon, 4 Jan 2016 18:51:43 +0000 (10:51 -0800)] 
fetch2/__init__.py: Add support for 7-Zip

7-Zip is a file archiver claiming the highest compression ratio.
This patch allows using 7-Zip commpressed files in bitbake recipes.
Two common formats are supported:

SRC_URI = "file://abc.tar.7z"
SRC_URI = "file://abc.7z"

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoutils: Remove double compile from better_compile
Richard Purdie [Mon, 4 Jan 2016 17:34:02 +0000 (17:34 +0000)] 
utils: Remove double compile from better_compile

Poking around the ast to correct linenumbers works well for runtime failures
but not for parsing ones. We can use blank linefeeds to correct the line
numbers instead, with the advantage that we don't need to double compile.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch2/local.py: avoid using PREMIRROR
Robert Yang [Mon, 4 Jan 2016 10:15:39 +0000 (02:15 -0800)] 
fetch2/local.py: avoid using PREMIRROR

The PREMIRROR isn't useful for "file://", so avoid using it, this is
good for searching speed and can reduce useless lines in log.do_fetch.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agosiggen: Change exception note into a warning
Richard Purdie [Mon, 4 Jan 2016 17:35:10 +0000 (17:35 +0000)] 
siggen: Change exception note into a warning

This makes no sense as just a note, its at least a warning and useful
to get an idea of which codepath is failing.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata: Drop misleading ExpansionError exception
Richard Purdie [Mon, 4 Jan 2016 17:33:26 +0000 (17:33 +0000)] 
data: Drop misleading ExpansionError exception

This codepath can be triggered by a python indentation error for example.
Showing it as an ExpansionError is misleading.

Change the code to add a warning about where the failure came from (in
particular giving the variable key name that triggered it) but raise the
proper exception.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocooker: Drop useless parsing exception
Richard Purdie [Mon, 4 Jan 2016 17:32:45 +0000 (17:32 +0000)] 
cooker: Drop useless parsing exception

The SyntaxError exception simply shows the recipe that failed to parse
which is pretty useless without the actual exception. We could make it
print more info, however we can just use one of the more generic handlers
instead and remove this one.

For a python indentation error, this leads to a much more readable error
message.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agodata: Pass lineno/filename data from build_dependencies
Richard Purdie [Mon, 4 Jan 2016 17:31:58 +0000 (17:31 +0000)] 
data: Pass lineno/filename data from build_dependencies

If parse_python() fails, the output is confusing. Passing in the extra
file/line data isn't expensive and improves readability significantly.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agocodeparser: Add support for correct linenumbers
Richard Purdie [Mon, 4 Jan 2016 17:31:19 +0000 (17:31 +0000)] 
codeparser: Add support for correct linenumbers

Currently, if there is something like a python indentation error in a
python function, the linenumbers and even file aren't reported correctly.

This allows lineno and filename parameters to be passed in to correct this.

The lack of a lineno parameter to python's compile() function is worked
around by using empty linefeeds. Ugly, but effective and with minimal
performance overhead.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoevent/utils/methodpool: Add a cache of compiled code objects
Richard Purdie [Sun, 20 Dec 2015 13:22:19 +0000 (13:22 +0000)] 
event/utils/methodpool: Add a cache of compiled code objects

With the addition of function line number handling, the overhead of
the compile functions is no longer negligible. We tend to compile
the same pieces of code over and over again so wrapping a cache around
this is beneficial and removes the overhead of line numbered functions.

Life cycle of a cache using a global like this is in theory problematic
although in reality unlikely to be an issue. It can be dealt with
if/as/when we deal with the other global caches.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoBBHandler: Improve IN_PYTHON_EOF handling
Richard Purdie [Sun, 20 Dec 2015 13:21:14 +0000 (13:21 +0000)] 
BBHandler: Improve IN_PYTHON_EOF handling

Now we're actively using the line numbers for other thins, having
magic values like IN_PYTHON_EOF causes problems, in particular, 32
bit overflow on 32 bit machines.

There is a neater way to signal eof to feeder(), just using an extra
parameter so use this instead and drop the IN_PYTHON_EOF magic values.

This has the added bonus that line numbers are then correct for
python functions at the end of files.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove 2 confusing parameters
Ed Bartosh [Thu, 17 Dec 2015 16:48:56 +0000 (16:48 +0000)] 
toaster: remove 2 confusing parameters

Removed nobrowser and brbe script parameters as both
are confusing and nobrowser is not used anywhere.

brbe parameter usage can only be justified if toaster
doesn't work properly and user has to manually connect
toaster to running bitbake server. Even in this scenario
it's very unlikely to achieve as toaster script is not
designed for this kind of usage.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: move setting of default values
Ed Bartosh [Thu, 17 Dec 2015 16:48:55 +0000 (16:48 +0000)] 
toaster: move setting of default values

Set default values of script parameters just before
they are parsed to increase readability.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: move startup checks to a better place
Ed Bartosh [Thu, 17 Dec 2015 16:48:54 +0000 (16:48 +0000)] 
toaster: move startup checks to a better place

Moved addr:port, bitbake.lock and toastermain.pid checks
to the place where the rest of Toaster starting happens.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove 2 unused functions
Ed Bartosh [Thu, 17 Dec 2015 16:48:53 +0000 (16:48 +0000)] 
toaster: remove 2 unused functions

Removed check_pidbyfile and notify_chldexit functions from
toaster script as they're not called in the script.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove addtoConfiguration function
Ed Bartosh [Thu, 17 Dec 2015 16:48:52 +0000 (16:48 +0000)] 
toaster: remove addtoConfiguration function

This function is useless as it's called just once
and makes code less readable.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: updated header of the toaster script
Ed Bartosh [Thu, 17 Dec 2015 16:48:51 +0000 (16:48 +0000)] 
toaster: updated header of the toaster script

Updated GPL information, years of development and
usage information. Removed outdated information about
2 ways of starting Toaster.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: add MANAGE variable
Ed Bartosh [Thu, 17 Dec 2015 16:48:50 +0000 (16:48 +0000)] 
toaster: add MANAGE variable

Used MANAGE variable to avoid repeating path to
manage.py in many places in toaster script.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove unused variable
Ed Bartosh [Thu, 17 Dec 2015 16:48:49 +0000 (16:48 +0000)] 
toaster: remove unused variable

Removed unused variable RUNNING from the toaster script.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: split long lines, add/remove whitespace
Ed Bartosh [Thu, 17 Dec 2015 16:48:48 +0000 (16:48 +0000)] 
toaster: split long lines, add/remove whitespace

Made toaster script more readable by splitting long lines and
removing and adding whitespace.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: check if address:port is in use
Ed Bartosh [Thu, 17 Dec 2015 16:48:47 +0000 (16:48 +0000)] 
toaster: check if address:port is in use

Used new management command checksocket to check if
Toaster can listen on address:port.

[YOCTO #8775]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: implement checksocket command
Ed Bartosh [Thu, 17 Dec 2015 16:48:46 +0000 (16:48 +0000)] 
toaster: implement checksocket command

Implemented new management command to check if it's
possible to listen on specified address:port.

[YOCTO #8775]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Improve exception error message
Richard Purdie [Fri, 18 Dec 2015 11:03:20 +0000 (11:03 +0000)] 
knotty: Improve exception error message

Instead of:
"""
can only concatenate tuple (not "int") to tuple
"""
we now see:

"""
Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/ui/knotty.py", line 324, in main
    termfilter.updateFooter()
  File "/media/build1/poky/bitbake/lib/bb/ui/knotty.py", line 210, in updateFooter
    lines = 1 + int(len(content) / (self.columns + 1))
TypeError: can only concatenate tuple (not "int") to tuple
"""

which makes tacking down and fixing the problem much easier.

Also ensure we set an error exit code.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Fix row/column function return value issue
Richard Purdie [Fri, 18 Dec 2015 11:02:41 +0000 (11:02 +0000)] 
knotty: Fix row/column function return value issue

When the row handling was introduced, one of the callbacks was
missed resulting in:

TypeError: can only concatenate tuple (not "int") to tuple

Fix it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobuildinfohelper: Update for buildstats layout change
Richard Purdie [Thu, 17 Dec 2015 14:54:55 +0000 (14:54 +0000)] 
buildinfohelper: Update for buildstats layout change

This updates buildinfo helper for the recent buildstats layout change

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agofetch: use orig localpath when calling orig method
Christopher Larson [Thu, 10 Dec 2015 18:57:23 +0000 (23:57 +0500)] 
fetch: use orig localpath when calling orig method

When a mirror tarball is fetched, the original fetch method is called, which
unpacks the mirror tarball. After the original method is called, it checks the
localpath of the mirror tarball rather than the clone path, which isn't ideal,
particularly if the mirror tarball was removed due to being out of date. We
know the original fetch method will do what it needs to do to get its content
in the form it needs from the mirror tarball, so we can use its localpath
instead.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Awais Belal <awais_belal@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoutils: Improve traceback from better_exec internal errors
Richard Purdie [Tue, 15 Dec 2015 17:42:40 +0000 (17:42 +0000)] 
utils: Improve traceback from better_exec internal errors

If you break the internals of better_exec(), you get a very weird
error about tb_next not being a method of None. Fix this by checking
we can step back a trace level.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoast/event/utils: Improve tracebacks to include file and line numbers more correctly
Richard Purdie [Tue, 15 Dec 2015 17:41:12 +0000 (17:41 +0000)] 
ast/event/utils: Improve tracebacks to include file and line numbers more correctly

Currently bitbake tracebacks can have places where the line numbers are
inaccurate and filenames may be missing. These changes start to try and
correct this.

The only way I could find to correct line numbers was to compile as a
python ast, tweak the line numbers then compile to bytecode. I'm open
to better ways of doing this if anyone knows of any.

This does mean passing a few more parameters into functions, and putting
more data into the data store about functions (i.e. their filenames
and line numbers) but the improvement in debugging is more than worthwhile).

Before:
----------------
ERROR: Execution of event handler 'run_buildstats' failed
Traceback (most recent call last):
  File "run_buildstats(e)", line 43, in run_buildstats(e=<bb.build.TaskStarted object at 0x7f7b7c57a590>)
NameError: global name 'notexist' is not defined

ERROR: Build of do_patch failed
ERROR: Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 560, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 497, in _exec_task
    event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 170, in fire
    fire_class_handlers(event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 109, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 81, in execute_handler
    ret = handler(event)
  File "run_buildstats(e)", line 43, in run_buildstats
NameError: global name 'notexist' is not defined

----------------

After:
----------------
ERROR: Execution of event handler 'run_buildstats' failed
Traceback (most recent call last):
  File "/media/build1/poky/meta/classes/buildstats.bbclass", line 143, in run_buildstats(e=<bb.build.TaskStarted object at 0x7efe89284e10>):
         if isinstance(e, bb.build.TaskStarted):
    >        trigger = notexist
             pn = d.getVar("PN", True)
NameError: global name 'notexist' is not defined

ERROR: Build of do_package failed
ERROR: Traceback (most recent call last):
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 560, in exec_task
    return _exec_task(fn, task, d, quieterr)
  File "/media/build1/poky/bitbake/lib/bb/build.py", line 497, in _exec_task
    event.fire(TaskStarted(task, logfn, flags, localdata), localdata)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 170, in fire
    fire_class_handlers(event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 109, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/media/build1/poky/bitbake/lib/bb/event.py", line 81, in execute_handler
    ret = handler(event)
  File "/media/build1/poky/meta/classes/buildstats.bbclass", line 143, in run_buildstats
    trigger = notexist
NameError: global name 'notexist' is not defined
----------------

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agorunqueue: Add support for <task>- syntax
Richard Purdie [Tue, 15 Dec 2015 16:42:18 +0000 (16:42 +0000)] 
runqueue: Add support for <task>- syntax

It can be useful to run all tasks up to but not including a specific task. The
main reason this was never added was the lack of a good syntax. This patch
uses the syntax <taskname>- to denote this behaviour which is simple, not
invasive and fits what we need from good syntax IMO, hence we can add this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tables Set a default order for the software recipes table
Belen Barros Pena [Mon, 14 Dec 2015 22:50:47 +0000 (22:50 +0000)] 
toaster: tables Set a default order for the software recipes table

Add default order by recipe name, so that the table content is sorted
when the page loads.

[YOCTO #8791]

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: tests Remove symlinks from toasteruitest folder
Mihail Stanciu [Fri, 11 Dec 2015 10:01:59 +0000 (10:01 +0000)] 
toaster: tests Remove symlinks from toasteruitest folder

Remove symlinks in the UI tests folder as they are causing
problems for bitbake upstream.

[YOCTO #8787]

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: rework checking of Django version
Ed Bartosh [Thu, 10 Dec 2015 03:56:43 +0000 (19:56 -0800)] 
toaster: rework checking of Django version

Checked django version considering information from
toaster-requirements.txt, e.g. if requirements file contains
line "Django>1.8,<1.9" toaster should be able to check that
requirement correctly.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: monkey patch Queryset
Ed Bartosh [Thu, 10 Dec 2015 03:56:42 +0000 (19:56 -0800)] 
toaster: monkey patch Queryset

Fixed 'database is locked' issue by monkey patching django QuerySet
methods.

The actual patching places were found by bisecting Django codebase.

This commit should be removed after Django is fixed if it's fixed
at all.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: removed extra calls of migrate
Ed Bartosh [Thu, 10 Dec 2015 03:56:41 +0000 (19:56 -0800)] 
toaster: removed extra calls of migrate

One manage.py migrate should be enough to apply migrations for
all applications. Extra calls just slow toaster script down.

Removed calls of migrate for orm and bldcontrol apps.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: work around 'database is locked' error
Ed Bartosh [Thu, 10 Dec 2015 03:56:40 +0000 (19:56 -0800)] 
toaster: work around 'database is locked' error

When sqlite can not cope with a stream of 'insert' queries it throws
'database is locked' exception.

Wrapping model.save in transaction.atomic context and repeating the call
should solve this issue.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: fixed format strings
Ed Bartosh [Thu, 10 Dec 2015 03:56:39 +0000 (19:56 -0800)] 
toaster: fixed format strings

Printing id as a number breaks toaster if object is not saved
yet as id/pk is None in this case.

Changed format spec to print id as a string in __str__
and __unicode__ methods of Build, Task and LayerVersion models.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use OneToOneField instead of ForeignKey
Ed Bartosh [Thu, 10 Dec 2015 03:56:38 +0000 (19:56 -0800)] 
toaster: use OneToOneField instead of ForeignKey

Used OneToOneField to reference BuildRequest in BRBitbake model.

Fixed django warning:
WARNINGS: Setting unique=True on a ForeignKey has the same effect
          as using a OneToOneField.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Amend regex for MySQL database URLs
Elliot Smith [Thu, 10 Dec 2015 03:56:37 +0000 (19:56 -0800)] 
toaster: Amend regex for MySQL database URLs

The database URL detection doesn't admit a MySQL URL without a port.

As this is a common case (e.g. you would set the HOST to a mysql.sock
path if pointing at a local MySQL server, with no port setting),
amend the regex so it will correctly recognise paths, as well
as HOST:PORT URLs.

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Remove compatible_layerversions() method
Elliot Smith [Thu, 10 Dec 2015 03:56:36 +0000 (19:56 -0800)] 
toaster: Remove compatible_layerversions() method

Remove compatible_layerversions() and replace calls to it with
calls to get_all_compatible_layer_versions().

The sorting done in compatible_layerversions() is not relevant,
and the code can be simplified by using get_all_compatible_layer_versions().

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Check Django version against toaster-requirements.txt
Elliot Smith [Thu, 10 Dec 2015 03:56:35 +0000 (19:56 -0800)] 
toaster: Check Django version against toaster-requirements.txt

Instead of hard-coding the required Django version in the start
script, look it up from the toaster-requirements.txt file.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Update deprecated manage.py command
Elliot Smith [Thu, 10 Dec 2015 03:56:34 +0000 (19:56 -0800)] 
toaster: Update deprecated manage.py command

syncdb is deprecated in favour of migrate in Django 1.7:
https://docs.djangoproject.com/en/1.8/releases/1.7/#schema-migrations

Update to the "migrate" command in Toaster's start script.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Prevent deprecation warnings for RedirectView
Elliot Smith [Thu, 10 Dec 2015 03:56:33 +0000 (19:56 -0800)] 
toaster: Prevent deprecation warnings for RedirectView

The API for RedirectView is due to change in Django 1.9, which
means that Toaster generates deprecation warnings.

Set the "permanent" flag when constructing RedirectView instances
to prevent this warning.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Update API used to make runbuilds methods run in transactions
Elliot Smith [Thu, 10 Dec 2015 03:56:32 +0000 (19:56 -0800)] 
toaster: Update API used to make runbuilds methods run in transactions

runbuilds previously had its methods decorated with
transaction.commit_on_success, which is now deprecated. transaction.atomic
is an (almost) drop-in replacement for this, so use this instead.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: rename get_query_set -> get_queryset
Ed Bartosh [Thu, 10 Dec 2015 03:56:31 +0000 (19:56 -0800)] 
toaster: rename get_query_set -> get_queryset

Renamed get_query_set to get_queryset as get_queryset causes
deprecation warning in Django 1.7 and is deprecated in Django 1.8

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Start Django machinery for database access
Elliot Smith [Thu, 10 Dec 2015 03:56:30 +0000 (19:56 -0800)] 
toaster: Start Django machinery for database access

buildinfohelper, with the new import paths for our Django models
and Django 1.8, was not getting an active connection to the database.

In buildinfohelper, call django.setup() explicitly to make sure
that the database connection is ready and models can be queried
and saved.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Create default project with get_or_create* method
Elliot Smith [Thu, 10 Dec 2015 03:56:29 +0000 (19:56 -0800)] 
toaster: Create default project with get_or_create* method

Rather than maintain data as part of the migrations (as was
done for the default project previously), create the default
(cli builds) project on demand as a by-product of getting
it from the database.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Fix references to app paths
Ed Bartosh [Thu, 10 Dec 2015 03:56:28 +0000 (19:56 -0800)] 
toaster: Fix references to app paths

The buildinfohelper runs outside of Django, but still needs
access to our Django app classes.

Previously, the imports referenced the toaster.* app, which worked
fine. But in Django 1.8, this causes an error about the same
module being loaded multiple times from different paths.

Change the paths to our Django modules so they don't cause
this error to be thrown. We can do this as we've added our
application libraries to sys.path in the buildinfohelper anyway.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Remove South migrations
Ed Bartosh [Thu, 26 Nov 2015 18:04:06 +0000 (20:04 +0200)] 
toaster: Remove South migrations

South has been deprecated in favour of Django's own migration framework,
so remove the old South migrations and replace them with Django ones.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: Upgrade to Django 1.8.6 and remove South
Elliot Smith [Thu, 10 Dec 2015 03:56:26 +0000 (19:56 -0800)] 
toaster: Upgrade to Django 1.8.6 and remove South

Upgrade Django to long-term support version.

Django now provides its own migration framework, so remove
requirement for South.

[YOCTO #8364]

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoasterui: process SetBRBE event
Ed Bartosh [Wed, 9 Dec 2015 14:25:49 +0000 (14:25 +0000)] 
toasterui: process SetBRBE event

Currently BRBE is known to toasterui only when build is
started. It's passed to it with BuildStarted event. This is
too late as if build fails earilier than build starts toasterui
can not inform Toaster about the failure.

Set BRBE as soon as it's provided by Toaster.
This should make toasterui to be able to inform Toaster
about early build failures, e.g. failures during recipe parsing.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: trigger SetBRBE event
Ed Bartosh [Wed, 9 Dec 2015 14:25:48 +0000 (14:25 +0000)] 
toaster: trigger SetBRBE event

Triggered MetadataEvent "SetBRBE" when TOASTER_BRBE variable
is set on bitbake server. This should make buildinfohelper
aware of the build request id, which is used to properly
report build status and failures back to Toaster.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: implement BitbakeController.triggerEvent
Ed Bartosh [Wed, 9 Dec 2015 14:25:47 +0000 (14:25 +0000)] 
toaster: implement BitbakeController.triggerEvent

This API will be used to pass data from Toaster to
toaster_ui and buildinfohelper.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoevent: Fix subprocess event error traceback failures
Richard Purdie [Wed, 9 Dec 2015 12:02:56 +0000 (12:02 +0000)] 
event: Fix subprocess event error traceback failures

If subprocess raises a CalledProcessError() error, e.g. from a call
like subprocess.check_call("false"), bitbake would try and pass the
object over IPC and fail, leading to an unusual error:

('__init__() takes at least 3 arguments (1 given)', <class 'subprocess.CalledProcessError'>, ())%

To avoid this, we turn the value into a string which prevents the
issues the IPC has trying to deal with the object (for the same reason
we deal with tracebacks here too).

[YOCTO #8752]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: toasterui Add ParseStarted/ParseProgress events to mask
brian avery [Tue, 17 Nov 2015 16:47:56 +0000 (16:47 +0000)] 
toaster: toasterui Add ParseStarted/ParseProgress events to mask

Toaster is not able to see ParseStarted and ParseProgress events
for command-line builds. This means it's not possible for Toaster
to detect failed builds, if the failure occurs at a point before
the BuildStarted event, as the build won't show up at all.

Add these events to the event mask, so that Toaster's toasterui
can detect and respond to them.

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agoknotty: Enforce terminal line limit to stop crazy scrolling
Richard Purdie [Mon, 7 Dec 2015 18:26:57 +0000 (18:26 +0000)] 
knotty: Enforce terminal line limit to stop crazy scrolling

If there are more tasks running than there are lines on the terminal, the data
scrolls in ways the UI wasn't designed for. This patch adjusts the UI just to
show the processes which fit onto the number of rows in the terminal window.
You can see the total number running from the counter in the top left as usual
and this makes warning and errors messages scrolling from the top of the window
work as designed.

Ultimately, scrolling would be nice but is for another time, this fixes the
biggest UI issue on highly parallel machines.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agobitbake: rename REGEX, REGEX_URI, and GITTAGREGEX.
Alexander Kanavin [Fri, 4 Dec 2015 14:59:26 +0000 (14:59 +0000)] 
bitbake: rename REGEX, REGEX_URI, and GITTAGREGEX.

Rename REGEX to UPSTREAM_CHECK_REGEX, REGEX_URI to UPSTREAM_CHECK_URI, and
GITTAGREGEX to UPSTREAM_CHECK_GITTAGREGEX to better reflect their purpose
and to reflect a common namespace.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: return back 'New project' button
Ed Bartosh [Mon, 7 Dec 2015 16:06:01 +0000 (16:06 +0000)] 
toaster: return back 'New project' button

The button was removed by mistake in merging modes patchset.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests Update UI tests to work with 2.0 changes
Mihail Stanciu [Mon, 7 Dec 2015 15:53:01 +0000 (15:53 +0000)] 
toaster: tests Update UI tests to work with 2.0 changes

Update tests that were referencing items removed in 2.0.

Update most xpath elements left to use IDs.

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: tests Automated build-mode backend tests
Mihail Stanciu [Mon, 7 Dec 2015 15:53:00 +0000 (15:53 +0000)] 
toaster: tests Automated build-mode backend tests

Add tests to check various backend scenarios that
require UI interaction.

Add necessary files for above tests (the sqlite file
and the default config json).

Signed-off-by: Mihail Stanciu <stanciux.mihail@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: unset environment variables
Ed Bartosh [Wed, 2 Dec 2015 18:02:59 +0000 (10:02 -0800)] 
toaster: unset environment variables

Toaster script sets environment variables when it starts.
It makes sense to unset them when toaster stops as they can
cause other programs to behave incorrectly.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: get rid of complicated heuristics
Ed Bartosh [Wed, 2 Dec 2015 18:02:58 +0000 (10:02 -0800)] 
toaster: get rid of complicated heuristics

Removed buildinfohelper code which was trying to guess layer version of
the recipe using build request information. The code caused creation of
duplicated recipes as it resulted in layer version from layer index
instead of returning build layer version. As a result of this Toaster
UI was not showing any information about recipes.

Default approach used to find layer version seems to work much better as
it finds proper layer version. Now toaster will use it as the only
way to find layer version.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove SDKMACHINE from project variables
Ed Bartosh [Wed, 2 Dec 2015 18:02:57 +0000 (10:02 -0800)] 
toaster: remove SDKMACHINE from project variables

Removed SDKMACHINE from predefined set of variables
for the project as it causes bitbake build error:
   SDKMACHINE is set, but SDK_ARCH has not been changed as a result

This variable does not need to be predefined as it's not used by
toaster.

It's still possible to specify it in project configuration
if needed. SDK_ARCH variable should be set too to avoid above
mentioned build failure.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: stop using toaster-pre.conf
Ed Bartosh [Wed, 2 Dec 2015 18:02:56 +0000 (10:02 -0800)] 
toaster: stop using toaster-pre.conf

This file is not needed anymore as toaster UI doesn't
write variables to it. It sets them directly on bitbake
server.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove writeConfFile API
Ed Bartosh [Wed, 2 Dec 2015 18:02:55 +0000 (10:02 -0800)] 
toaster: remove writeConfFile API

This API is not used anymore as toaster doesn't write variables
to configuration files anymore. It sets variables through its
connection to bitbake server.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: set varibales on bitbake server
Ed Bartosh [Wed, 2 Dec 2015 18:02:54 +0000 (10:02 -0800)] 
toaster: set varibales on bitbake server

Set project variables using connection to bitbake server
instead of writing them to toaster configuration files.

This is a way to avoid rewriting configuration files before
and after every build, triggered by toaster UI.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: implement BitbakeController.getVariable
Ed Bartosh [Wed, 2 Dec 2015 18:02:53 +0000 (10:02 -0800)] 
toaster: implement BitbakeController.getVariable

Added new API to get value of bitbake variable from bitbake server.
The API will be used to update INHERIT variable instead of writing
it to the toaster configuration files.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: buildinfohelper Broaden the toaster created recipe data case
Michael Wood [Wed, 2 Dec 2015 18:02:52 +0000 (10:02 -0800)] 
toaster: buildinfohelper Broaden the toaster created recipe data case

When build information is the 'original' source of the information we
need to return the recipe that was created rather than the copy of the
recipe that is taken for keeping build history. We do this already for
command line triggered builds, but we also have this case for custom
images. We can simply check if the built_recipe exists instead of
special casing this.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: do not create duplicate HelpText objects
Ed Bartosh [Wed, 2 Dec 2015 18:02:51 +0000 (10:02 -0800)] 
toaster: do not create duplicate HelpText objects

buildinfohelper code expects only one HelpText object per
build/variable/description.
Current code creates more than one such an object, which causes
toastergui to crash with this exception:
 MultipleObjectsReturned: get() returned more than one HelpText -- it returned 2!

Used git_or_create API to ensure that only one HelpText object is
created.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove usage of BUILD_MODE variable
Ed Bartosh [Wed, 2 Dec 2015 18:02:50 +0000 (10:02 -0800)] 
toaster: remove usage of BUILD_MODE variable

As both modes can be used at the same time we can't have any
difference in UI between modes.

Removed all conditional statements that used BUILD_MODE.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: do not terminate bb server
Ed Bartosh [Wed, 2 Dec 2015 18:02:49 +0000 (10:02 -0800)] 
toaster: do not terminate bb server

Toaster needs bb server to be running all the time due
to merged analysis and managed modes. Server gets restarted
before every build triggered by UI, but it shouldn't be
terminated as it will influence command line builds.

[YOCTO #8279]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove stopBBServer API
Ed Bartosh [Wed, 2 Dec 2015 18:02:48 +0000 (10:02 -0800)] 
toaster: remove stopBBServer API

Removed stopBBServer API from build controller as toaster
doesn't stop bitbake server anymore. It's reused for both
types of builds: triggered by UI and started manually.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: reimplemented startBBServer method
Ed Bartosh [Wed, 2 Dec 2015 18:02:47 +0000 (10:02 -0800)] 
toaster: reimplemented startBBServer method

Rewritten LocalhostBEController.startBBServer to use
'toaster restart-bitbake' and read bitbake port number from
bitbake.lock.

Removed complicated logic of running oe-init-memres and looking for
bitbake port number in the logs.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove _setupBE function
Ed Bartosh [Wed, 2 Dec 2015 18:02:46 +0000 (10:02 -0800)] 
toaster: remove _setupBE function

This function is not needed as build environment is always created
because of the new way to run Toaster. It can be only sourced after
oe-init-build-env is sourced.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: implement 'toaster restart-bitbake'
Ed Bartosh [Wed, 2 Dec 2015 18:02:45 +0000 (10:02 -0800)] 
toaster: implement 'toaster restart-bitbake'

This implementation allows to have functionality of restarting
bitbake in toaster script. It can be used by toaster script and
build controllers.

[YOCTO #8279]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: implement start_bitbake function
Ed Bartosh [Wed, 2 Dec 2015 18:02:44 +0000 (10:02 -0800)] 
toaster: implement start_bitbake function

Separated functionality of starting bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: implement stop_bitbake function
Ed Bartosh [Wed, 2 Dec 2015 18:02:43 +0000 (10:02 -0800)] 
toaster: implement stop_bitbake function

Separated functionality of stopping bitbake server and observer
processes.

This functionality will be used by build controllers to restart
bitbake processes.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: update brbe and project attributes
Ed Bartosh [Wed, 2 Dec 2015 18:02:42 +0000 (10:02 -0800)] 
toaster: update brbe and project attributes

Updated attributes of buildinfohelper object as they can
be changed for every build. For example brbe is set by
runbuilds for every build triggered by Toaster UI.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: start 'manage.py runbuilds' in the script
Ed Bartosh [Wed, 2 Dec 2015 18:02:41 +0000 (10:02 -0800)] 
toaster: start 'manage.py runbuilds' in the script

Running runbuilds machinery in background allows Toaster to
start builds initiated by toaster UI.

Added runbuilds pid file to the list in webserverKillAll to
kill runbuilds the same way as runserver process.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: make runbuilds to loop
Ed Bartosh [Wed, 2 Dec 2015 18:02:40 +0000 (10:02 -0800)] 
toaster: make runbuilds to loop

Made runbuilds to loop to avoid having a loop in shell code and
initialize heavy Django init machinery every second.

Ignored exceptions to prevent exiting a loop.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: use parent of the build dir
Ed Bartosh [Wed, 2 Dec 2015 18:02:39 +0000 (10:02 -0800)] 
toaster: use parent of the build dir

Assigned TOASTER_DIR to the parent of the build directory.
This should fix local controller crash as it assumes that
TOASTER_DIR is a root of local poky and tries to clone it.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: check for toaster configuration later
Ed Bartosh [Wed, 2 Dec 2015 18:02:38 +0000 (10:02 -0800)] 
toaster: check for toaster configuration later

Moved check for toasterconf.json after check of build environment.
We'll need some variables from build environment to find toasterconf.json
better way.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: remove unused variable
Ed Bartosh [Wed, 2 Dec 2015 18:02:37 +0000 (10:02 -0800)] 
toaster: remove unused variable

Removed variable RUNNING as it's not used anymore
in the toaster script.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: change toasterconf.json logic to use TEMPLATECONF, like oe-setup-builddir
brian avery [Fri, 20 Nov 2015 18:29:34 +0000 (18:29 +0000)] 
toaster: change toasterconf.json logic to use TEMPLATECONF, like oe-setup-builddir

This changes the way we pick a toasterconf.json file so that it
matches the way oe-setup-builddir does it. We now base it on TEMPLATECONF
found in the .templateconf file.

Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: run bitbake the same way
Ed Bartosh [Wed, 2 Dec 2015 18:02:36 +0000 (10:02 -0800)] 
toaster: run bitbake the same way

Run bitbake in toaster script the same way as it's run
by localbuildcontroller.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: set DATABASE_URL in toaster script
Ed Bartosh [Wed, 2 Dec 2015 18:02:35 +0000 (10:02 -0800)] 
toaster: set DATABASE_URL in toaster script

Set environment variable DATABASE_URL in bitbake/bit/toaster
Variable value is obtained by running 'manage.py get-dburl'

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: implement get-dburl command
Ed Bartosh [Wed, 2 Dec 2015 18:02:34 +0000 (10:02 -0800)] 
toaster: implement get-dburl command

Implemented management command to call getDATABASE_URL API.
It will be used to get database url from toaster shell script
by running 'manage.py get-dburl'

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agotoaster: don't allow to run toaster as a script
Ed Bartosh [Wed, 2 Dec 2015 18:02:33 +0000 (10:02 -0800)] 
toaster: don't allow to run toaster as a script

Removed support of starting toaster as a script.

Sourcing a toaster script becomes the only way to start it.
It's consistent with the way oe build system is started by sourcing
oe-init-build-env. It also returns user back to shell, so user can
continue running builds without having to open new terminal window.

[YOCTO #8279]

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils: improve edit_bblayers_conf() handling of bblayers.conf formatting
Paul Eggleton [Fri, 20 Nov 2015 04:11:16 +0000 (17:11 +1300)] 
lib/bb/utils: improve edit_bblayers_conf() handling of bblayers.conf formatting

Make the following improvements to edit_bblayers_conf():

* Support ~ in BBLAYERS entries
* Handle where BBLAYERS items are added over multiple lines with +=
  instead of one single long item

Also add some comments documenting the function arguments and return
values as well as a set of bitbake-selftest tests.

(This function is used by the bitbake-layers add, remove and
layerindex-fetch subcommands, as well as devtool when adding the
workspace layer).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agolib/bb/utils: fix error in edit_metadata() when deleting first line
Paul Eggleton [Fri, 20 Nov 2015 04:11:15 +0000 (17:11 +1300)] 
lib/bb/utils: fix error in edit_metadata() when deleting first line

If you tried to delete the variable on the first line passed to
edit_metadata() this failed because the logic for trimming extra blank
lines didn't expect the list to be empty at that point - fix that bad
assumption.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
9 years agowget.py: parse only <a> tags
Alexander Kanavin [Fri, 4 Dec 2015 11:00:20 +0000 (13:00 +0200)] 
wget.py: parse only <a> tags

For two reasons:
1) The important one: we hit the following bug when doing upstream version checks
on some webpages:
https://bugs.launchpad.net/beautifulsoup/+bug/1471755

2) Also, documentation for beautifulsoup states that memory usage and
speed is improved that way.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>