Commit Graph

3646 Commits

Author SHA1 Message Date
Richard Purdie ffaa0f1b8a bitbake: parse/BBHandler: Avoid repeatedly resetting FILE
If we're not going to change the value of FILE, or we know it isn't
going to have changed (ext == bbclass), don't set FILE.

This avoids messy looking history of the variable as well as optimises
parsing speed slightly.

(Bitbake rev: 88e4600aa66dda2e6c807f9d97af8982bcd8817b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-05 16:42:01 +01:00
Alexandru DAMIAN 6e23a3deb9 bitbake: toaster: more HTML5 fixes
More HTML5 fixes highlighted by tests on new data.

(Bitbake rev: a52242bb4d928b9abba8a3489e350e4615a9da29)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:47 +01:00
Alexandru DAMIAN 225daf45a4 bitbake: toaster tests: enable url check test
Integrate the HTML5 validation as a test instead of
calling a separate script. This enables us to get the
HTML5 validation report as part of patch-level
testing.

gitignore the cache directory created by the http client

(Bitbake rev: 931caab56301876cb8632b289835c2545a096ef6)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:46 +01:00
Alexandru DAMIAN 29143915ae bitbake: toaster/tts: Fix tests
(Bitbake rev: f4257f8df3be0627bdc7209fe34d674c42baf8d2)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:46 +01:00
Alexandru DAMIAN 356809ff40 bitbake: toaster: enable no browser start
We enable a "nobrowser" parameter that inhibits
the launch of a browser when toaster starts.

This is useful for integration with automated startup scripts
and enables headless testing.

(Bitbake rev: ccf7f39d470fe6d743b58b1140c19cb8da31ecaf)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:46 +01:00
Michael Wood b3189f3071 bitbake: orm: Fix all failing unit test
This fixes all the unit tests for the orm. Also added is the ability to
set a custom Layer index if you want to avoid using the public one by
specifying TTS_LAYER_INDEX

(Bitbake rev: dfbcbe116d0b987b850f67056f02f489ac0b8360)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:46 +01:00
Michael Wood 3480be741e bitbake: bldcontrol: Fix all failing unit tests
This fixes the unit tests for the bldcontrol it requires the
implementation of a new Exception type so that a known Exception can be
handled. Also fixed is the path to the toaster conf files so that the
test doesn't need to be run from the top level directory and the ability
to specify the values of TTS_SOURCE_DIR and TTS_BUILD_DIR and
TTS_TEST_ADDRESS used for testing.

Edited by Alex Damian to correct the rebasing of the localhostbecontroller.py
file.

(Bitbake rev: c17933271cd273a346115c2ee0b6695ff3f981ce)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:46 +01:00
Alexandru DAMIAN 22a0d8aab2 bitbake: toastergui: add tests for xhr_datatypeahead calls
In order to make sure we replace the xhr_datatypeahead calls
with similar APIs, we add tests that validate the data returned
by the xhr_datatypeahead. A copy of these tests will be enabled
for each type of datatypeahead that will be replaced.

(Bitbake rev: 9a3197fba46b38e5863e7ded11e4bf9530cfcc9b)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:46 +01:00
Alexandru DAMIAN 65c805eb6a bitbake: toastergui: tests for the all-projects API point
This patch adds Django tests that verify that the 'all-projects'
page returns a valid HTML page when invoked normally, containing
the project name; and valid JSON containing API-needed fields
if the GET parameter `format` is set to "json"

(Bitbake rev: 9edd61fe7afaf273ed31d214af9251462182ad4f)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:46 +01:00
Alexandru DAMIAN fea4a82a2b bitbake: toasterui: replace cookie-based preferences with session data
We switch from storing the user preferences using cookies
to saving them in the server-side session.

Patch for "count/pagesize" and "orderby" fields in the table-based
pages.

This patch will solve two problems:
* the browser-side race between the GET header data and the cookie data
* page breakages when field names chances in orderby statements.

(Bitbake rev: 125d0e05805247450be0675e281a21bd6146d108)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:45 +01:00
Alexandru DAMIAN 1b6a50c6b2 bitbake: toaster: refactor checksettings command
This patch refactors the checksetting command to prevent
early return from the handle function.

It also adds a check that marks IN PROGRESS builds at startup time
as FAILED. Minor changes to BuildRequest and Build classes
ensure useful string representation for the objects.

(Bitbake rev: adf67dd79dbf6b585bf8cd54f99c389409b88ecd)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:45 +01:00
Ed Bartosh 52fe880f9e bitbake: toastergui: Consider task name when restarting a build in /builds
Previously the same issue was fixed for project view.
'Run again' button now restarts builds using target:task also in builds view.

[YOCTO #7442]

(Bitbake rev: ae6349a13f11b6fa90fe5603b000bef14ee0f2f0)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:45 +01:00
Ed Bartosh 6fab4cb701 bitbake: toaster-gui: Show task name for the builds in /builds
Task name was only shown for the latest builds in project view.
Now it should be shown also in builds view.

(Bitbake rev: 6492349d50a2048b1cbebab482bfd075bb48dd96)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:45 +01:00
Michael Wood e5aa569d47 bitbake: toaster: Add an invalidate cache method on data update signal
Instead of relying on the cache expiring over an amount of time we can
listen to the changed notification on the models to invalidate the
cache. Also fixes overlapping cache names.

(Bitbake rev: eb0b1450e421cf65b407b1ac0336ac24ffc626e8)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:45 +01:00
Michael Wood 2de01a68eb bitbake: toaster: Port layerdetails to ToasterTables
This ports the layerdetails page to using ToasterTables
Also some whitespace and strict clean ups in the existing layerdetails
js and html template.

(Bitbake rev: 8ce35f81631e31539aeb82f8a85abbb3312e5097)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:45 +01:00
Michael Wood a0ea663b83 bitbake: toaster: Add a simplified ToasterTable template
This is like the normal ToasterTable template but with a number of
features removed such as edit columns and has a lower profile compared
to the "main" tables.

(Bitbake rev: 4ce35c74d2b1ecd68c494fa9bab3c1133f9679c1)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:44 +01:00
Michael Wood e3a4905d08 bitbake: toaster: Fix toastertable header
Fixes regression introduced by 'tables updates for HTML5 compliance'

(Bitbake rev: 406a7f81420f7baa5cbfc034b573a4d692b98874)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:44 +01:00
Ed Bartosh 6a9efefbba bitbake: toastergui: show relative paths in configvars view
Reworked filtering of config paths.

Stripped clone paths, topdir and its parent directory from the paths
to config files in configvars view.

[YOCTO #7463]

(Bitbake rev: 873087b11653848ec2704d67de5680a265b71eaa)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:44 +01:00
Alexandru DAMIAN 9dcfa32cf1 bitbake: toastergui: table header bring back
This patch brings back the table header, which I mistakenly
took out when fixing HTML5 compliance.

(Bitbake rev: 9855e0b9735ebf0a6c622bee6ec787dfc1d9e474)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:44 +01:00
Alexandru DAMIAN 56c5ff920c bitbake: toaster logger: assign projects to all builds
Bitbake logger now sets a default project if the TOASTER_BRBE
or TOASTER_PROJECT Bitbake variables are not set.

This a necessary step in getting all builds under a project,
as to unify the MANAGED and interactive modes.

Other small fixes are included, related to the size of the
fields in the database.

(Bitbake rev: 5e0bf388f4e5c1cc493ac8264785e631bad2f672)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:44 +01:00
Alexandru DAMIAN e3e85bdf71 bitbake: toaster logger: refactor recipe and layer file paths
This refactoring brings the "local_path" of the
layer from the Layer object to the Layer_Version object, which
is more appropriate as different checkouts of the same
Layer may live in different directories.

This enables us to store Recipe file paths relative to a Layer_Version
at all times, aleviating the need to store full file paths in the
database. We also turn the prefix of the path (e.g. virtual:native
path name space) into a pathflag field.

In turn, this solves the problem of mis-identification of tasks based
on the recipe file paths, since we can also match the namespace of the
file paths on the recipe files.

[YOCTO #7594]

(Bitbake rev: ec43dc569e370767c709dec225cbee0c99151c19)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:43 +01:00
Alexandru DAMIAN a5236be47f bitbake: toaster: enable server-side sessions for all usages
In an effort to fix client-side session storage using
cookies, we enable server-side session support for all pages.

(Bitbake rev: ba10b6f89767c0dad8a2b064f42a84956764e9da)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:43 +01:00
Michael Wood 5da543c7b5 bitbake: toaster: Fix build button current project race
Make sure the current project value is set before we check to see if the
project is buildable. Also update the blacklist url patterns where we
aren't displaying the button.

[YOCTO #7739]

(Bitbake rev: e169ed5cf190af62586f3e1c6ed6db6120406e05)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:43 +01:00
Richard Purdie b8caddb57a bitbake: data: Make expandKeys deterministic
At least in theory, the order the keys are expanded in can make
a difference, particularly if there is key overlap.

We also want to ensure that any underlying base key is processed
before any overridden version of that variable (FOO before FOO_x)
which helps the update_data removal code I've been testing.

(Bitbake rev: 863b6add24c211d64ba7931647084321f2d65889)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:16 +01:00
Richard Purdie 3db9d6e02d bitbake: ConfHandler: Fix bogus dependency problems
Adding a dependency when errors occur accessing a file when calling
handle() is not the correct thing to do. THe handle() code calls
resolve_file() which can raise an exception without ever touching
"fn" itself, it has also already marked all the dependencies correctly.

This leads to bogus files being resolved to the local cwd and
hence triggers reparses for no good reason.

The solution is to simply remove the bogus dependency.

(Bitbake rev: 366af3be1cffd64e4a79c15990c1e05869022c14)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:16 +01:00
Richard Purdie 91c45c0163 bitbake: BBHandler: Drop cwd from search path
Whilst bitbake has done this for a long time, the behaviour of resolving
class files against cwd is not desirable. This can be seen during
base configuration parsing when looking for base.bbclass where a dependency
on cwd is added. If cwd then changes, the cache is invalid and triggers a
re-parse.

The only real option is to drop this entry and if files can't be found, we
fix BBPATH in the cases where it needs fixing. I didn't find any in the
random selection of layers I tested parsing locally.

(Bitbake rev: 508aad9d5db7e51328b1fd6ee53b4bc3720a30b7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:16 +01:00
Richard Purdie 08b77c8cef bitbake: cooker/utils: Improve parsing profiling
Currently the cooker parsing processes each dump an individual profile
which is ok, but means absolute numbers of function calls for a given load
can be tricky to determine as parsing of recipes may go to different pool
threads on different runs.

This change collects up the individual thread parsing results and processes
them into one profile output. The profile processing function in utils
needed tweaks to allow this to work.

(Bitbake rev: d3d2541aacd1ea560da0d8b25a3ea3f0563dee70)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:16 +01:00
Richard Purdie 553267d8d9 bitbake: tests/data: Add key expansion unit test
This ensures basic key expansion works and that overlapping
keys generate a log message.

(Bitbake rev: ed5a8954ac923eda9750a636c5bb5b95ffce664f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:16 +01:00
Richard Purdie bde0f60971 bitbake: tests/data: Add log parsing test code
This allows us to write tests which ensure a particular action generates
a particular log message.

(Bitbake rev: b30ee0aba51a35a194a4338b988f93ece1ed281c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:16 +01:00
Richard Purdie 8d8b02aacd bitbake: data: Revert expandKeys warning move
This was incorrect, it *must* be done next to the rename as a previous
may overlap with the current one and we need to detect this case.

I'll add a test case to better catch this problem in future.

(Bitbake rev: 5e9d0911cd86e980ab310cc0d79c9383fbc2c844)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:16 +01:00
Richard Purdie 30cba374cc bitbake: data: Clean up expandKeys None value handling
This comparison is interesting even in the case of empty vales. Enabling
this warning actually found a bug in the metadata in avahi. Make the
code handle None specifically and also remove the dead code path in the
second if statement.

(Bitbake rev: a4cd4c56284812efb2a2bc0c8667ddad073f8e94)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 10:17:16 +01:00
Richard Purdie a32937c501 bitbake: data: Move warning code to the first loop for performance
By doing this we can take advantage of the expansion cache before
starting write operations on the data store.

(Bitbake rev: 702b42a47904f2378dd819e7463b3206883c2651)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:33:06 +01:00
Richard Purdie 9e9d05205a bitbake: siggen: Don't crash if number of task dependencies change
If the number of task dependencies change you currently get
a traceback when using diffsigs.

(Bitbake rev: c6798b431571aae18bb8699ac6e3ec75b731d719)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:33:06 +01:00
Richard Purdie 7fab819f7f bitbake: cache: Clean up getVar usage to modern syntax/style
No functional change.

(Bitbake rev: 0eb75a34bd9731e9de7bc9600a7418a927561fdb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:33:06 +01:00
Jason Wessel 5ee122244a bitbake: bitbake-worker: Fix regression with unbuffered logs
I noticed that I was seeing loss of the log files when hitting
control-c while debugging a function in bitbake.  In fact if you
take a recipe and replace its compile function as shown below let
it run for a few seconds and hit control-c, you will see first
hand that log data is not there.

do_compile () {
        while [ 1 ] ; do
                echo -n "Output date: "
                date
                sleep 1
        done
}

It turns out there was a regression introduced by commit:
d0f0e5d9e6 which created the bitbake worker.  Since the bitbake
worker is started in its own process space, it needs the exact
same code added from commit: 88429f018b where the problem was
fixed the first time around.

(Bitbake rev: 8d1748f75763b4a66516cc46d5457ee6404b1b68)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:33:06 +01:00
Ash Charles 70c1d222c0 bitbake: fetch/hg: Disable checksums for archived downloads
Like the Git fetcher, the Mercurial fetcher shouldn't expect recipes to
provide a checksum.  As described [1], recipes using a mercurial
fetcher that don't provide a checksum will fail in a the repository has
previously been downloaded and archived.

Credit to Rafaël Carré for figuring out the bug.

[1] https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg41328.html

(Bitbake rev: 2df35a25b4968f64adfa673d5b73442c1a30829d)

Signed-off-by: Ash Charles <ashcharles@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-26 10:33:06 +01:00
Mike Looijmans 5170177719 bitbake: fetch2/git.py: Add gitpkgv_revision alternative version information
gitpkgv_revision returns a sortable revision number that can be used
in the PKGV variable for example. To mimic meta-openembedded gitpkgv
behaviour to provide a sortable revision numner, one could set the
following:

PKGV = "1.0+${@bb.fetch2.get_srcrev(d, 'gitpkgv_revision')}"

This would yield a package version like "1.0+69+fb5eb80".

(Bitbake rev: 989c08f62aff7b707c25c692c23284f16506b7bc)

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-24 07:20:56 +01:00
Mike Looijmans f03e108fb1 bitbake: fetch2/__init__.py: Make get_srcrev output configurable
The idea here is to support package version numbering similar to gitpkgv in
meta-openembedded. This commit is the first step towards such functionality.

The original plan was to add a "get_pretty_srcrev" method to the fetcher, as
per Richard's suggestion [1]. While writing this, I noticed that it would
become a copy of get_srcrev with only two lines changed. So to create something
more Pythonic than a boolean argument and conditionals around the calls to the
fetcher's sortable_revision, I just made the method to be called on the fetcher
an argument to the method. Defaulting to 'sortable_revision' prevents affecting
existing code.

Now if the git fetcher were to implement, say 'gitpkgv_revision' one could
set the following in a recipe:
  PKGV="1.2+${@bb.fetch2.get_srcrev(d, 'gitpkgv_revision')}"
and this would yield the same result as gitpkgv's GITPKGV variable.

See for the discussion leading to this change:
[1] http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100345.html

(Bitbake rev: 2f1f4483493cc290f5d2c07f9906e90eaea2f4c1)

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-24 07:20:56 +01:00
Scott Rifenbark 2f41470fd6 bitbake: bitbake-user-manual: Updated "Delete a Task" section for broken deps
Fixes [YOCTO #7803]

I added information for the scenario where deleting a task using the
deltask command could "break" implicit dependencies.

(Bitbake rev: 5ea3a206bb5beef4c12d56d9e42e29d324a08e16)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-22 16:52:33 +01:00
Scott Rifenbark 16caaabfcc bitbake: bitbake-user-manual-customization.xsl: Pointing to mirrors for XSL files.
Instead of pointing to the Sourceforge area, which seems to flake out
every so often, we are now pointing to a mirror to get the XSL files
needed to build the manual.

(Bitbake rev: d9811231b4c8211446bd9275084c26a4718cd175)

Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 22:09:36 +01:00
Marcin Smoczyński 7310c3c925 bitbake: fetch/git: Fix uri in git checkstatus
Pass proper repository url without arguments after a semicolon.

Executing checkuri on a rule with git repository in SRC_URI does
not report errors when working offline because wrong repository
url is passed to the ls-remote command. For example
"bitbake -c checkuri glibc" command executes:
"git -c core.fsyncobjectfiles=0 ls-remote git://sourceware.org/git/glibc.git;branch=release/2.21/master"
command in a shell subprocess to determine if url is valid.
Shell subprocess executes in fact 2 commands:
"git -c core.fsyncobjectfiles=0 ls-remote git://sourceware.org/git/glibc.git"
and
"branch=release/2.21/master"

First one returns 127 or 128 depending on error but second one
returns 0 because it is just env variable setup. Therefore we're not catching
connection error.

[YOCTO #7558]

(Bitbake rev: efa44d04137977f883db4a643b0f774e91514722)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 22:09:36 +01:00
Randy Witt 8b8859a8fe bitbake: toaster: Remove dependency on daemon application
The bitbake observer is now started using python subprocess. This should
allow for toaster to run without installing the "daemon" application.

[Yocto #7271]

(Bitbake rev: 1dd599ddfcdb547bee49bd7d86acddf64c675b42)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 11:58:45 +01:00
Randy Witt 37c0b9852b bitbake: localhostbecontroller: Fix server search debug message
When the output from the commands ran was redirected to
"toaster_server.log" instead of the console, the debug message stating
the port on which bitbake is running would no longer appear.

This change makes looks at "toaster_server.log" for the port rather than
the _shellcmd output. This makes the debug message useful again.

(Bitbake rev: 9097bae469cb1e005092c11610d92e908b8f19f5)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 11:58:45 +01:00
Robert Yang 3371a7bc96 bitbake: fetch2/hg.py: add clean function
Fixed when bitbake vim -ccleanall:

File: '/path/to/bitbake/lib/bb/fetch2/__init__.py', lineno: 1462, function: clean
     1458:    def clean(self, urldata, d):
     1459:        """
     1460:        Clean any existing full or partial download
     1461:        """
 *** 1462:        bb.utils.remove(urldata.localpath)
     1463:
     1464:    def try_premirror(self, urldata, d):
     1465:        """
     1466:        Should premirrors be used?
File: '/path/to/bitbake/lib/bb/utils.py', lineno: 633, function: remove
     0629:        subprocess.call(['rm', '-rf'] + glob.glob(path))
     0630:        return
     0631:    for name in glob.glob(path):
     0632:        try:
 *** 0633:            os.unlink(name)
     0634:        except OSError as exc:
     0635:            if exc.errno != errno.ENOENT:
     0636:                raise

Exception: OSError: [Errno 21] Is a directory: '/path/to/downloads/hg/vim.googlecode.com/hg/vim'

(Bitbake rev: 02763306662e15a4750395e5eab64ba98d1f9939)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 11:58:45 +01:00
Paul Eggleton aefc80c02e bitbake: lib/bb/utils: fix and extend edit_metadata_file()
Fix several bugs and add some useful enhancements to make this into a
more generic metadata editing function:
* Support modifying function values (name must be specified ending with
  "()")
* Support dropping values by returning None as the new value
* Split out edit_metadata() function to provide same functionality
  on a list/iterable
* Pass operation to callback and allow function to return them
* Pass current output lines to callback so they can be modified
* Fix handling of single-quoted values
* Handle :=, =+, .=, and =. operators
* Support arbitrary indent string
* Support indenting by length of assignment (by specifying -1)
* Fix typo in variablename - intentspc -> indentspc
* Expand function docstring to cover arguments / usage
* Add a parameter to enable matching names with overrides applied
* Add some bitbake-selftest tests

Note that this does change the expected signature of the callback
function. The only known caller is in lib/bb/utils.py itself; I doubt
anyone else has made extensive use of this function yet.

(Bitbake rev: 20059e4d5ab9bf0f32c781ccb208da3c95818018)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 11:58:45 +01:00
Paul Eggleton ba0546bfaf bitbake: lib/bb/utils: fix several bugs in edit_metadata_file()
* Fix unchanged assignments being dropped if other lines changed
* Fix not passing variable name from single-line assignments to the
  function
* Fix not trimming the trailing quote from values

(Bitbake rev: 0b0c82f49cf2de887967d305768cbd95314bb171)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 11:58:45 +01:00
Paul Eggleton 0d9c45289a bitbake: lib/bb/utils: add function to get layer containing a file
In certain contexts it can be useful to find the layer that a file (e.g.
a recipe) appears in.

Implements [YOCTO #7723].

(Bitbake rev: 3bf9c8830c5d5eea5502230d5af84ebd87ad5849)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-19 11:58:44 +01:00
Richard Purdie bc162d21dd bitbake: tests/parse: Add file missing from previous commit
(Bitbake rev: 76f095107a0eaf987a5a6a48eed7b98f87aea121)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:40:44 +01:00
Richard Purdie 71626c1b94 bitbake: tests/fetch: Add mirror of mirror tests
Add some tests of mirrors or mirrors to the fetcher unittests.

(Bitbake rev: e33d82bc10283d533f928836d56a6f0af80ea5c1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:51 +01:00
Richard Purdie 2be2271906 bitbake: fetch2: Improve mirror building function error handling
First, when building mirror urls we don't do any fetching so we should never
be calling clean functions.

Currently, if a mirror url fails, we don't process it further to see
if there are any mirrors of the mirror.

We should do this even when the mirror url fails, else we may miss out
on valid/useful mappings, particularly in the case of file:// urls.

(Bitbake rev: b7fd3ec9994f664b17fc86423e6e7afac07e897b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-16 22:31:51 +01:00