Compare commits

..

347 Commits

Author SHA1 Message Date
Stephano Cetola
6b66e9317f Allow for simultaneous do_rootfs tasks with rpm
Give each rootfs its own RPM channel to use.  This puts the RPM metadata
in a private subdirectory of $WORKDIR, rather than living in DEPLOY_DIR
where other tasks may race with it.

This allows us to reduce the time that the rpm.lock is held to only the
time needed to hardlink the RPMs, allowing the majority of the rootfs
operation to run in parallel.

Also, this fixes the smart tests by generating an index for all packages
at the time of the test, rather than using the one provided by the
rootfs process.

Original credit for the enhancement should go to Steven Walter
stevenrwalter@gmail.com.

(From OE-Core rev: a92c196449c516fe51786d429078bbb1213bb029)

Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-12 15:25:22 +01:00
Jose Perez Carranza
d11e8e1109 systemd_boot: Enable module to test systemd bootloader
Module systemd_boot created wtih a class "Systemdboot"
 and a test case "test_efi_systemdboot_images_can_be_built"
 to test new systemd bootloader.

 [YOCTO #9706]

(From meta-yocto rev: 4366060660f15592261227ca47088b492383f8cc)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 13:35:57 +01:00
Richard Purdie
2c043e3655 Revert "systemd_boot: Enable module to test systemd bootloader"
This reverts commit 3f859816aef3c3dba35cfbea15f0c56483205544, applied
to the wrong repo.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 13:35:57 +01:00
Michael Wood
e274a5167e bitbake: toaster: buildinfohelper Add handling local layers (i.e. non-git) layers
Adds handling of the non-git layers to create and update the
corresponding layer objects in Toaster.

(Bitbake rev: 0a9b5d7d9655dbb09d458fc6e330e932f0f9dab6)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:30 +01:00
Michael Wood
4ac57fb73e bitbake: toaster: bldcontrol model BRLayer Add corresponding local_source_dir
Sync the BRLayer object with the new field added to the Layer object.
The BRLayer (BuildRequest Layers) are snapshots of the layers in the
project at build time and therefore need to mirror the required fields
of the layer object.

(Bitbake rev: a3112c922f036425977abffa0137b9133f61fcd6)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H
cb5ed74e7f bitbake: toaster: adapt xhr_import_layer test locally imported layer
Update xhr_import_layer test to use locally imported
layer in local_source_dir.

[YOCO #9911]

(Bitbake rev: f855490dd04281beb5ae65d82430203d9fd263fc)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H
5827ae0a08 bitbake: toaster: update build configuration page
Update layer branch and layer commit section
in the build configuration page for locally
imported layers. For locally imported layers
this secion goes as "Not applicable".

[YOCO #9911]

(Bitbake rev: 4ca3f602a955e01d445fb4789496e925f8d4234b)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H
f5acb4213b bitbake: toaster: update recipe details page
Update Layer branch and Layer commit
in recipe details page. For local layer
imported from toaster these fields are
not applicable.

[YOCO #9911]

(Bitbake rev: 35f7faabff17ca577fdd2e84bb25125047f66345)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H
875770daf7 bitbake: toaster: update package detail page
Update package details pages layer branch
and layer commit section for locally imported
layers. We add Not applicable to them along
with a helper text, which helps user understand
why its not applicable to those layers.

[YOCO #9911]

(Bitbake rev: 6978f65af4eabe91f65a6766799578c84a0988aa)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H
3a5039949a bitbake: toaster: updte build tables for locally imported layers
Update the build tables section for locally
imported layers. Here we do not provide informations
such as branch or commit. Because those are locally
imported layer(s).

[YOCO #9911]

(Bitbake rev: 1b0934b45d3704de604405826de9fc1da51ceae1)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H
186320fedf bitbake: toaster: update the tables information
Update table informations for pages:
1) Compatible layers
2) Compatible image recipes
Added Not Applicable to the fields of locally
imported layers because they are not git version.

[YOCO #9911]

(Bitbake rev: 7e73f8583a0f92d73b42410e1c960b6f2976a557)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H
ef617e6f34 bitbake: toaster: collect details for local dir imported from ui
Collect the dir path imported from UI and make
sure that its getting added to bblayers.conf.
This patch exactly does the same job. Any layer
which is imported locally need not be cloned
again to _toaster_clones dir.

[YOCO #9911]

(Bitbake rev: 5669157994fc220a018e37927600988f3fd43271)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:29 +01:00
Sujith H
8cad51965d bitbake: toaster: add local_source_dir field to model
Add a new field local_source_dir to model.
This will clearly differentiate us from the
vcs_url which is for git path.
Adding migration file 0010_layer_local_source_dir_path.py
along with this patch.

[YOCO #9911]

(Bitbake rev: 83763d89f9d0bc535e930a2094ba8201675d40be)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H
494eae3db0 bitbake: toaster: add local directory to the db
Adding local directory to the database.
The local directory is added to vcs_url,
field of db.

[YOCO #9911]

(Bitbake rev: 2c3d48e7cd21a999ef145081352774f1759cd5e4)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H
b3fa98d449 bitbake: toaster: improve the display when local dir is added
The helper text gets displayed accordingly when mouse
is hovered above the layers. If its a local directory
then no more branch is mentioned. Only directory path
is mentioned.

[YOCTO #9911]

(Bitbake rev: c1961c7844cab5b9c9144f3b4946197097f53e17)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Belen Barros Pena
331c1c6f0a bitbake: toaster: update css file for layer import
Update the css file for the layer import.
This changes will improve the UI for the
task.

[YOCO #9911]

(Bitbake rev: a41d0400478186c983334d8f83780639e7361c91)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H
42d3a414fe bitbake: toaster: add local_source_dir to the needed_fields
This change will help us know if local_source_dir
is null or if there is value associated with this
field. This change will help us display the details
for duplicate layers tryied to import locally.

[YOCOT #9911]

(Bitbake rev: 4350b01f776e6e35745c3eb9440587973de00eec)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H
836f332552 bitbake: toaster: control the selection of git and local repo
Changes made in this patch will help user to select
either repo based on git and local. This patch also
improves the help provided to user so that user can
understand them and take necessary action to proceed.

[YOCOT #9911]

(Bitbake rev: 26bee4c2c05dc202857270cd5f56abff79674ca7)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Sujith H
c2c58a1879 bitbake: toaster: add import of local directory to UI
This patch will help to add local directory
to UI. The modification is made in importlayer.html
file. The radio buttons are created to separate
selection of git based repo and local directory.

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

[YOCOT #9911]

(Bitbake rev: 78e5edb8ed4bf6c8b0fb87fcf17a82485c145920)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:28 +01:00
Ed Bartosh
953ba7a221 bitbake: toaster: fix unhandled exception
manage.py lsupdates throws DataError exception if the recipe can't be
saved to the MySQL database:
    django.db.utils.DataError: (1406, "Data too long for column 'license' at row 1"

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

(Bitbake rev: 01891c13ae8dcba64e5cf79956f1b64c2afdaae3)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
f6261da9c0 bitbake: toasterui: ensure that the Build object is always available
Many of the methods in toasterui and buildinfohelper rely
on the internal state of the buildinfohelper; in particular, they
need a Build object to have been created on the buildinfohelper.

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

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

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

(Bitbake rev: 0990b4c73f194ec0be1762e4e48b1a525d8349fb)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
f17ab95c79 bitbake: toaster-tests: add test for showing self-dependent task
Toaster occasionally records a task which depends on itself.

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

[YOCTO #9952]

(Bitbake rev: b7a699e701785b5bd8da97b6e1b760a1c6dd05f5)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
98ef970c8e bitbake: toaster: prevent infinite loop when finding task dependencies
Toaster occasionally records a task which depends on itself.
This causes a problem when trying to display that task if it
is "covered" by itself, as the code does the following: for
task A, find a task B which covers A; then, recursively
find the task which covers B etc. If B == A, this loop becomes
infinite and never terminates.

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

[YOCTO #9952]

(Bitbake rev: 88c471c7e5995abb5bca62990b91650277b6c926)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
2ff892d87c bitbake: toaster-tests: add tests for reverting to default sort
Add tests for ToasterTable UI table sort reverting, which can
only be exercised via the browser.

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

[YOCTO #9836]

(Bitbake rev: 5b016338478d784fd048ba2baae121c3e558090c)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
dd784598cd bitbake: toaster: reset table to default orderby when orderby column is hidden
When a ToasterTable is sorted by a column, and that column is
hidden from view, the sort doesn't revert to the default for the
table.

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

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

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

[YOCTO #9836]

(Bitbake rev: a28377067b6f381bbc98db82f5c45fca6620f7ad)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
01c8496d47 bitbake: toaster: show loading spinner after creating custom image
Creating a custom image through the "New custom image" dialog
can sometimes result in a long pause between pressing the button
to create the image, and being transferred to the page showing
details of its content. This can make it appear as though pressing
the button had no effect.

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

[YOCTO #9475]

(Bitbake rev: dd8bede91e08c0b64b949ca98c74e6144da88fd1)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
6172fb1923 bitbake: toaster-tests: fix erroneous message when test fails
When one of the layer details tests fails (as it occasionally
does, if running on a machine under heavy load, due to sync issues),
the error message shown is misleading, as it is something like:

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

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

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

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

(Bitbake rev: 34943b2278efe99c6744399e04a47cdda630468e)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
cf0b07c96f bitbake: toaster-tests: add tests for most recent builds state changes
Add tests for the state transitions in the "most recent builds"
area of the all builds page.

[YOCTO #9631]

(Bitbake rev: b95681cf38475903ad4f73059313dda8c0dccef6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
36f71db680 bitbake: toaster-tests: add tests for build dashboard menu and summary visibility
Test that the build dashboard only shows a menu and a build
summary area if a build has properly "started" (i.e. has at least
one Variable object associated with it).

[YOCTO #8443]

(Bitbake rev: 9e16f76fb254ae967ded6c21251243b2af9b16b6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Elliot Smith
504a85822e bitbake: toaster-tests: add tests for build time links in the all builds page
When a build fails, it shouldn't have links on its build time in the
recent builds area or in the all builds table.

[YOCTO #8443]

(Bitbake rev: 3d7b247512eb01607741f5f6ce7cb01d241e49e7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith
2d80b902b8 bitbake: toaster: adjust build dashboard for failed builds
Remove the side bar and build details modules for failed builds.

[YOCTO #8443]

(Bitbake rev: 9d68a5bfdccd399791e1af048fefa73b5df90bcb)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith
e387a7ab9d bitbake: toaster: add started property to Build
Add a property to the Build model which records whether
the BuildStarted event has occurred for the build.

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

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

[YOCTO #8443]

(Bitbake rev: aa151a4d2de4a54fe3075a8c56a4935158398a18)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith
dce5037646 bitbake: toaster: remove links from time field on failed builds
Failed builds don't have any time data recorded for them,
so the time field in the builds table, the time shown
in the recent builds area, and the build time shown in
the build dashboard should not be links for failed builds.

[YOCTO #8443]

(Bitbake rev: 6f9c472d95ee800da079f6b828b956d9f8c67ce6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith
9ed45f7974 bitbake: toaster: tweak styling and typos in recent builds area
Help icons need to have the Bootstrap tooltip() method called on
them so that the popups are correctly styled.

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

Fix pluralisation of errors and warnings shown.

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

[YOCTO #9631]

(Bitbake rev: 98a923ff14188832ac44e0dbafc73bcba10e25da)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith
82d998d6c6 bitbake: toaster: show "Tasks starting..." until the first task completes
To prevent showing a "0% of tasks complete" message for a long time,
don't show the progress bar until the first task has finished.

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

[YOCTO #9631]

(Bitbake rev: 5529bcd860d2932b967a064ae28690ac5a725342)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith
dd99cf957d bitbake: toaster: show progress of recipe parsing in recent builds area
Modify buildinfohelper and toasterui so that they record the
recipe parse progress (from ParseProgress events in bitbake)
on the Build object.

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

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

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

[YOCTO #9631]

(Bitbake rev: f33d51d46d70e73e04e325807c1bc4eb68462f7b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith
952ffb3e1f bitbake: toaster: move most recent builds templating to client
The most recent builds area of the all builds and project builds
table needs to update as a build progresses. It also needs
additional functionality to show other states (e.g. recipe parsing,
queued) which again needs to update on the client side.

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

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

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

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

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

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

[YOCTO #9631]

(Bitbake rev: c868ea036aa34b387a72ec5116a66b2cd863995b)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Elliot Smith
c471740f5b bitbake: cooker: add BuildInit event
In situations where a bitbake run fails before the build
properly starts and BuildStarted is fired, a UI has no way
to get at the targets passed to the build. This makes it
difficult for the UI to report on the targets which failed.

Fire a BuildInit event before running buildTargets() or
buildFile(). This enables a UI to capture targets passed to
buildTargets(), even if the build fails (e.g. the targets
themselves are invalid).

[YOCTO #8440]

(Bitbake rev: ac02fda870965bf7d44ff5688eda54d2d11ab9c7)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Michael Wood
f4e65d1cd0 bitbake: toaster: fixtures Add README
Add README to explain fixtures directory

(Bitbake rev: 4060776e408ec6baec3bafba79ac5db1bc380f01)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:26 +01:00
Michael Wood
71f553b022 bitbake: toaster: Remove old toaster config loading mechanism
This has been replaced using django's inbuilt loaddata.
Django command documented at:
https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-loaddata

(Bitbake rev: 3edd33aff2b9eef82090dc4f9b5461f901aec8be)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood
49039829e1 bitbake: toaster: lsupdates Add spinner for parsing/http fetch
Adds a spinner so that you know that the parse and http fetch from the
layerindex is in progress.

(Bitbake rev: e1c1c8827f3892551084bf1c0909c1b33f0dca83)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood
33a4006529 bitbake: toaster: checksettings call django's loaddata instead of custom command
Call django's inbuilt loaddata command to load the appropriate fixtures.
We also attempt to load a fixture called "custom" and fail silently if
we don't have one. This is where initial customisations can be done to
load particular settings or data into Toaster (for example layers or
default values for variables)

Make sure the value for TEMPLATECONF is available to checksettings so
that we can have a go a working out which default data to load.

(Bitbake rev: 7d14ca8cbabbb893e507a66e4cc6e3e77c1e8c84)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood
72fa18fb35 bitbake: toaster: Add poky and openembedded configuration fixtures
These fixtures provide a recommended default configuration of toaster for
either using bitbake and oe-core or as part of poky.
They can be used as the sample configuration for writing custom configurations.

(Bitbake rev: d2f4ffbf061e874a7731441f8346fdc568e9f07f)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:25 +01:00
Michael Wood
a1629a2b26 bitbake: toaster: tests test_new_project_page Catch button not enabled exception
When using firefox and selenium we get an exception generated when a
disabled button click is attempted. This should happen in the test but
we need to catch the exception to make sure it doesn't cause the test to
fail.

[YOCTO #10056]

(Bitbake rev: 06f74fe91f8e162f49a4e856a62a97093b48262a)

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>
2016-08-11 00:07:09 +01:00
Randy Witt
cae9e6f695 bitbake: toaster: --help now returns 0 instead of 1
If the user explicitly passes in "--help" then it should return 0. This
is the convention follow by the typical application. This allows the
user to check for options without triggering an error.

(Bitbake rev: 1d5102fe6c932dad1c2b975385e10a33a91ba1a4)

Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:09 +01:00
Ulrich Ölmann
5d1d1774ec bitbake: siggen: Fix typo
(Bitbake rev: 40f605199fb3ec2549611508b7576c64d735b2b7)

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:09 +01:00
Terry Boese
93817932de bitbake: fetch2/gitannex.py: use 'git annex init' instead of 'git annex sync'
The git annex fetcher needs git annex to be initialized.  Previously
it was using 'git annex sync' to do this, but that has the downside
of moving the checkout to the tip of the default branch.  This means
that tags, SRCREV, etc don't work in the gitannex case.

(Bitbake rev: c1a57e2dd7fc96834643be5591a96f239215481a)

Signed-off-by: Terry Boese <terry.boese@vecima.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:08 +01:00
Richard Purdie
82da1e6f6c bitbake: persist_data: Fix py3 update stack overflow
Revision d0f904d407f57998419bd9c305ce53e5eaa36b24 accidentally broke
items() and values() and made them cause stack overflows. Undo that
breakage.

(Bitbake rev: 88c5beca705efa7df4a96fb2aaf3f13c336ac328)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:07:08 +01:00
Alexander Kanavin
12c8a50c60 maintainers.inc: add recently added recipes
Also fix up a few typos, and reassign piglit.

(From meta-yocto rev: e610973406be2f5ff61a99939c463f189486729e)

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>
2016-08-10 10:46:35 +01:00
Alejandro Hernandez
33b01282e2 linux-yocto: Update genericx86* SRCREVs for linux-yocto 4.4
Upgrades to linux version 4.4.15

(From meta-yocto rev: eee273eeaf3d2a95c4535af198479f71ff9fb63e)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:35 +01:00
Alejandro Hernandez
4534741168 linux-yocto: Update genericx86* SRCREVs for linux-yocto 4.1
Upgrades to linux version 4.1.28

(From meta-yocto rev: da898f3da00d6e74f7f69d89b47c7529ebc7b20d)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Jose Perez Carranza
dd53025d24 poky: update supported distros
Update existing supported distros CentOS and OpenSuse to avoid
unsupported distro warning, Add SUSELINUX for leap version.
For Yocto Project releases 1.7 was dropped and 2.1,2.2 added.

[Yocto #10067]

(From meta-yocto rev: ce1fe45e9a18a82e2b95ea7e0b088ba595ceeee6)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Mariano Lopez
a6630c2310 bitbake: fetch: Fix use of tar's --exclude option for tar >= 1.29
Starting from tar 1.29 the --exclude option won't work
anymore if is not used before the path. There are some
fetch modules that copy the ptest using tar and --exclude
option. This fixes these for bitbake.

[YOCTO #9763]

(Bitbake rev: cc71d5d9da71ea5f21d02f3b2fbf119bd2d794f0)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Ioan-Adrian Ratiu
87cb470304 dbus: backport stdint.h build fix
This patch fixes an error where dbus configure doesn't detect
stdint.h correctly.

Upstream commit 1bfde222 on branches dbus-1.10 and master

(From OE-Core rev: 5ed0d5a7d9b051a551a6de644bf6a42b87c12471)

Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
bavery
5aca5bc9a1 base-files: restrict resize to run on serial consoles only in profile │·
We don't need/wan't to run resize on an ssh connection. It's useless and
it breaks the Eclipse SSH debug connection. So, we added a check.

YOCTO #9362

(From OE-Core rev: 655778769f50d3aff74d7a436d28ac31b6aebb11)

Signed-off-by: bavery <brian.avery@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Khem Raj
b6ecbee4b2 libunwind: Do not use gold for linking
This effectively reverts the commit
3dd233ac0c80393824100c54bb525236f8290fd2

gold now emits errors on copy relocs against
protected symbols what ld.bfd did in past, however
it seems its too conservative.

This does not fix the case for folks who
use gold as default linker, however it
does make bintuls 2.27 work with default
configuration of OE

(From OE-Core rev: 0092a076adb11cac411c86389af84bb96169730f)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Khem Raj
e0ad5a9dcb webkitgtk: Disable gold for mips/mips64
with binutils 2.27, mips has got the gold support
but it doesnt work for webkitgtk _yet_ therefore
disable it for now.

(From OE-Core rev: 3f8543f31c230a89a54cc43c1d38263a58141699)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Ross Burton
ad79a894a7 connman: clean up musl fixes
The upstreamable include fixes have been sent upstream.  The patch set adds
AC_USE_SYSTEM_EXTENSIONS so we don't need to explictly define _GNU_SOURCE
anymore.

(From OE-Core rev: 6582e066fd9f9d4880e84cccbcdbb68606389309)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Ross Burton
fc08ecf8b2 connman: disable version-scripts to fix crashes at startup
With binutils 2.27 on at least MIPS, connmand will crash on startup.  This
appears to be due to the symbol visibilty scripts hiding symbols that stdio
looks up at runtime, resulting in it segfaulting.

This certainly appears to be a bug in binutils 2.27 although the problem has
been known about for some time:

https://sourceware.org/bugzilla/show_bug.cgi?id=17908

As the version scripts are only used to hide symbols from plugins we can safely
remove the scripts to work around the problem until binutils is fixed.

(From OE-Core rev: 0194531627735c1f5643ff1bd1bca27ca05c8e95)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
Aníbal Limón
3ac3f3f309 oeqa: start() add remaining args SimpleRemoteTarget and QemuTinyRunner
Now Runner's support extra_bootargs for the kernel so add
extra_bootparams to the start() methods to avoid exception.

(From OE-Core rev: 4c28c03a2322fbcb9a5c268b08eaeb71d940ee04)

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>
2016-08-10 10:46:34 +01:00
Stefan Agner
4a4a24fccc busybox: Fix busybox-init on non-tty consoles
When using non-tty consoles (e.g. VirtIO console /dev/hvc0) the
current init system fails with:
process '/sbin/getty 115200 hvc0' (pid 545) exited. Scheduling for restart.
can't open /dev/ttyhvc0: No such file or directory

The first field needs to be a valid device. The BusyBox inittab example
explains as follows:
"<id>: WARNING: This field has a non-traditional meaning for BusyBox init!

The id field is used by BusyBox init to specify the controlling tty for
the specified process to run on.  The contents of this field are
appended to "/dev/" and used as-is."

(From OE-Core rev: a53393082f331a613cb3eb973a07bab22cefcde8)

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:34 +01:00
George McCollister
b51959e3c8 uboot-sign: do_concat_dtb(): cd to $B
Prior to running oe_runmake make sure $B is the cwd. This is required
due to bitbake commit 67a7b8b021badc17d8fdf447c250e79d291e75f7
"build: don't use $B as the default cwd for functions".

Without this change, do_concat_dtb fails with:
| ERROR: oe_runmake failed
| make: *** No targets specified and no makefile found.  Stop.

(From OE-Core rev: 6dca3dee34b587157d0d49c590a177ff1dabb374)

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
George McCollister
c1a6945d7e uboot-sign: Handle .rom signing the same as .img
Handle u-boot.rom signing (U-Boot as x86 BIOS replacement) the same way
that u-boot.img signing is handled.

(From OE-Core rev: 94e3f427bbeb005d8443e9d822c3182f280df470)

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
George McCollister
749d7771ce kernel-fitimage: Add x86 support
For x86, bzImage must be built instead of zImage.

Include setup.bin (which is required to boot the kernel) in the fitimage
and always use a load/boot address of 0x00090000.

For details see:
http://git.denx.de/?p=u-boot.git;a=blob;f=doc/uImage.FIT/x86-fit-boot.txt

(From OE-Core rev: 1a65d11d4b8f056fdf22c31a92d1e58dec6d89f6)

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
George McCollister
ec755d2524 kernel-fitimage: add initramfs support
If INITRAMFS_IMAGE is set, build an additional fitImage containing the
initramfs. Copy the additional fitImage and the source (*.its) file, used
to create it to DEPLOYDIR. The fitImage containing the initramfs must be
built before do_deploy and after do_install to avoid circular dependencies.

UBOOT_RD_LOADADDRESS - Specifies the load address used by u-boot for the
                       initramfs.
UBOOT_RD_ENTRYPOINT  - Specifies the entry point used by u-boot for the
                       initramfs.

(From OE-Core rev: b406a89935f148779569fa3770776e009dd51f13)

Signed-off-by: George McCollister <george.mccollister@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Andrew Bradford
3153bd381c kernel-fitimage.bbclass: do_assemble_fitimage(): cd to $B
Prior to assembling the fitimage, ensure that $B is the cwd due to
bitbake commit 67a7b8b021badc17d8fdf447c250e79d291e75f7 "build: don't
use $B as the default cwd for functions".

Without this change, do_assemble_fitimage() fails like:

Log data follows:
| DEBUG: Executing shell function do_assemble_fitimage
| arm-ka-linux-gnueabi-objcopy: 'vmlinux': No such file
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_assemble_fitimage

(From OE-Core rev: 42d50e8f5f3a98e50a0f50473ebc83dc6347b634)

Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Herve Jourdain
d90eaa8518 linux-dtb.inc: Support for .dtbo files for dtb overlays
(From OE-Core rev: 831207ee8fa6fedd6080191bb77a871b0f33e1c1)

Signed-off-by: Herve Jourdain <herve.jourdain@neuf.fr>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Robert Yang
a960d9b401 packagefeed-stability.bbclass: fix multilib + rpm
* Fix multilib + rpm since its multilib package name is special.
* Update SSTATE_DUPWHITELIST to avoid shared location conflicted error.
* Fix message when "not copying", now the messages are:
  Copying packages for recipe <foo>
  Not copying packages for recipe <foo>

(From OE-Core rev: 647fc7913c3d1f98efe36f01fd4e0edf2366e1a6)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Alistair Francis
ce8e654e2c runqemu: qemuzynqmp: Add Linux boot support
Add support to direct boot Linux instead of just booting u-boot.

(From OE-Core rev: e5c6a78db46192800669f1b392351f6b52f3e20c)

Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Vladimir Zapolskiy
6f2fa0a018 package: correct subprocess.Popen.communicate() return values
This is a non-functional change, which intends to correct element
names of a tuple returned by Popen.communicate().

Both in python2 and python3 subprocess.Popen.communicate() method
returns a tuple (stdoutdata, stderrdata), thus old assignments and
collateral comments are incorrect from human's point of view, however
formally there is no error in the code.

The change is desired to have to avoid copy-paste errors in future.

(From OE-Core rev: cdd9bae381deb15ac84e11a39f9d72f2757c1583)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Vladimir Zapolskiy
b30aeb3e32 chrpath: correct subprocess.Popen.communicate() return values
This is a non-functional change, which intends to correct element
names of a tuple returned by Popen.communicate().

Both in python2 and python3 subprocess.Popen.communicate() method
returns a tuple (stdoutdata, stderrdata), thus old assignments and
collateral comments are incorrect from human's point of view, however
formally there is no error in the code.

The change is desired to have to avoid copy-paste errors in future.

(From OE-Core rev: f8c21df86bae5a85e221b69b91b347aeba6be4c3)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:33 +01:00
Markus Lehtonen
a48fea275b license: improve handling of license files with identical basenames
Previously, find_license_files() in license.bbclass just blindly assumed
that all different licenses specified in LIC_FILES_CHKSUM have unique
filenames. As a consequence, only the last one of these similarly named
license files was copied and the rest were "lost". This patch changes
the behavior so that all license files get copied. However, if multiple
identically named files are found, they are renamed to <file>.0,
<file>.1 etc.

The patch also changes the handling of NO_GENERIC_LICENSE slightly.
Previously, only basenames of NO_GENERIC_LICENSE and LIC_FILES_CHKSUM
were compared when searching for the correct license file. After this
patch NO_GENERIC_LICENSE must have the full path, matching what is
specified in LIC_FILES_CHKSUM. This is required in order to be able
to handle identical filenames (basenames) consistently. For example, if
you have:
LICENSE = "my-custom-license"
LIC_FILES_CHKSUM = "file://src/LICENCE;md5=d41d8cd98f00b204e9800998ecf8427e"

you must specify:
NO_GENERIC_LICENSE[my-custom-license] = "src/LICENCE"

[YOCTO #9663]

(From OE-Core rev: d5e1375884e509ec745bac43f1f7f7950f62f280)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
California Sullivan
da72327ab0 sysvinit-inittab_2.88dsf.bb: Allow aliasing with SERIAL_CONSOLES_CHECK
With some hardware the name of the device node and the name in
/proc/console differ. This causes SERIAL_CONSOLES_CHECK to not enable
working consoles in these cases. This patch changes SERIAL_CONSOLES_CHECK
to have an optional alias for the checked consoles. The new format is:

<device>:<alias to check(optional)>

Fixes [YOCTO #9440].

(From OE-Core rev: 91d9f3271c12fb755ab332637b17650d5fe75ce2)

Signed-off-by: California Sullivan <california.l.sullivan@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Ross Burton
95403e3ecd buildhistory: output package variables in a repeatable order
This code was outputting variables by iterating a dictionary.  In Py2 this
always results in the same iteration order but with Py3 the order changes every
execution, which resulted in buildhistory having to store diffs where fields
were simply re-ordered.

(From OE-Core rev: f9faa8df85317d12743134a44576b4882a9fb22a)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Maxin B. John
7b33b23d0e nettle: update LICENSE info for version 2.7.1
LICENSE_${PN} shouldn't contain anything that is not specified in LICENSE.

[YOCTO #10075]

(From OE-Core rev: 2ef6b50547a809fe92edf41b7a557f918f167ead)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Maxin B. John
2be5ee7e0a gst-player: update the callback for delete-event
provide similar behaviour for Media Player's quit and close callback
functions.

[YOCTO #10045]

(From OE-Core rev: 5cf3ae34df0a39deead8b029353b41a60e48c24a)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Alexandre Belloni
aca6dae9dc dpkg: Avoid automatic target architecture detection
dpkg is using a script (dpkg-architecture.pl) to detect the target
architecture automatically.
Unfortunately, it is using the cross compiler prefix to do the detection
and for ARM, oe-core is using <vendor>-linux-gnueabi for toolchains with
and without call-convention hard. The script then always detects
'armel' and never gets 'armhf' for call-convention hard.

This solves:
dpkg: error processing archive evtest_1.32+0+b8343ec112-r0_armhf.deb (--install):
 package architecture (armhf) does not match system (armel)
 Errors were encountered while processing:
 evtest_1.32+0+b8343ec112-r0_armhf.deb

(From OE-Core rev: b01a01ff47e09da4aaa2db992380ca0498f0e5ae)

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Maciej Borzecki
0e421c93a8 ca-certificates: remove -- separator
Options and directory separator -- slipped past the patch removing
Debianims, thus resulting in failures on hosts running Fedora.

(From OE-Core rev: a8431689983f5860173548acd899e6806906e4d1)

Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Khem Raj
309a6e01e3 world-broken: Add libunwind for musl/arm
gcc and libunwind race and when libunwind wins
results are build fails for gcc as described
this is only seen on musl/arm since on musl
/usr/include is search before gcc fixed headers
and unwind.h is in fixed headers. So it works
ok on glibc but not on musl due to reversed search
order.

(From OE-Core rev: 2e9a88a21d21f2f71769899888fbbc994bc708f0)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Khem Raj
6d84986631 strace: Fix build with mips/mips64 on musl
SIGEMT doesnt exist on musl

(From OE-Core rev: a18457e3318da21b642018897a0df29cb543deea)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:32 +01:00
Aníbal Limón
feb125eb17 oeqa/utils/httpserver.py: HTTPServer enable thread connection handling
HTTPServer now supports multiple connections using Python threads.

(From OE-Core rev: 1d45b7bd611b900bc00530144ec0634307b1314f)

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>
2016-08-10 10:46:32 +01:00
Mariano Lopez
262c81e3ca quilt/acl/attc/sed: Fix use of tar's --exclude option for tar >= 1.29
Starting from tar 1.29 the --exclude option won't work
anymore if is not used before the path. There are some
recipes that copy the ptest using tar and --exclude
option. This fixes these for OE-Core recipes.

[YOCTO #9763]

(From OE-Core rev: 2ba55933c81f78f4e4c36e21c59e935f74ce0f52)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Stefan Müller-Klieser
1f00fa182b alsa-utils: fix installed-vs-shipped for bat
The bat PACKAGECONFIG does not install the test script correctly. Fix
this by following the packaging used for the other bash scripts. While
at it, fix some tabs.

(From OE-Core rev: 3a9551479678f97a83db22f213a54169ab4fc989)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Andrej Valek
50c23e6c26 openssl: fix add missing make depend command before make library
Settings from EXTRA_OECONF like en/disable no-ssl3, are transferred
only into DEPFLAGS. It means that settings have no effect on output files.
DEPFLAGS will be transferred into output files with make depend command.

https://wiki.openssl.org/index.php/Compilation_and_Installation#Dependencies

(From OE-Core rev: e3c251427a305780d3257a011260bd978de273d5)

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Jacob Kroon
17d728dede terminal: Add sleep in pid-monitor loop
Monitoring the process started by gnome-terminal was
spinning in a busy-loop. Insert some sleeping so that
we don't eat all the cpu.

(From OE-Core rev: 314937429d700204f296cfd1c0c5f215a2e5b939)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Ross Burton
ce1cf85bd2 consolekit: don't ship /var/log/ConsoleKit
This directory is created on demand, and won't be visible if /var/log is a
tmpfs, so don't bother shipping it.

(From OE-Core rev: c2991efb6f4894061ee99b62cef4024be51dcdbf)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Markus Lehtonen
7633b81aac package.bbclass: warn about files under symlinked directories
[YOCTO #9827]

(From OE-Core rev: 27b285bd641d62f65154e6deec5146c0c8bb1458)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Markus Lehtonen
961b5269cd package.bbclass: better handling of middle-path dir symlinks
For example in a directory structure like this
    .
    ├── symlink -> foo/bar
    └── foo
        └── bar
            └── file
'file' could be referenced by specifying e.g. 'foo/bar/file' or
'symlink/file'.  In cases like this populate_packages() might crash if
the file was referenced (in FILES) via the symlinked directory. The
outcome depends on how the user defined FILES_pn.  This patch should
make the function behave more consistently. It looks for files which are
referenced via symlinked directories and handles them separately,
failing if their parent directory is a non-existent path. For example,
defining FILES_{PN} = "symlink/file" causes a build failure because
symlinks target 'foo/bar' is not included at all.

[YOCTO #9827]

(From OE-Core rev: 29d1738329ddf4e63844a9ad1158a1d41e2ee343)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Pascal Bach
416c4bc009 util-linux: make prlimit a separate package
Busybox doesn't provide a similar tool so having it in
a separate package allows to us it in addition to busybox without having
to include all of util-linux.

Before it was part of the top level util-linux package.
Now it is a separate package util-linux-prlimit but the top level package
still RRECOMMENDS it so for most users nothing should change.

(From OE-Core rev: e364ecc1216b04f2b61a88a623d2e9b5199af261)

Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
mingli.yu@windriver.com
07d9c3a41d lzo: update ptest output format
The output format was updated to match yocto ptest rules:
<result>: <testname>
where the result can be PASS, FAIL, or SKIP, and the testname
can be any identifying string.

(From OE-Core rev: 5d09bfbeb898306298af1073d5d3d7512403b99c)

Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Ross Burton
9ec7cef3d0 oeqa/selftest: disable report-error class when builds are expected to fail
Some invocations of bitbake are expected to fail, so we don't want to report the
errors to errors.yoctoproject.org.  Also rewrite the messages in
test_invalid_patch so they reflect reality.

[ YOCTO #10052 ]

(From OE-Core rev: 51f74a0d1ce4de9d311becee8e7d7cc7cd703d45)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Davis, Michael
b26e09b748 pseudo: Add nobody user and group
Nodejs expects the user and group nobody to exist on global install commands.
The target build works as base-passwd contained it, however the fallback passwd did not.
This broke the SDK if nodejs was included.

(From OE-Core rev: 40b89061c1efe8c150c1ac0886616d1b6facc2a0)

Signed-off-by: Michael Davis <michael.davis@essvote.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:31 +01:00
Alejandro Hernandez
b192bc02bb python3: Upgrade from 3.5.1 to 3.5.2
LICENSE did not change, only dates were changed

Upstream:
 - use_packed_importlib.patch
 - CVE-2016-5636.patch

Other patches were rebased on python3-natives patch

(From OE-Core rev: e38f649fe08c504bb4aea2004ef6980c346e474c)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Alejandro Hernandez
3ab991bee2 python3-native: Upgrade from 3.5.1 to 3.5.2
LICENSE did not change, only dates were changed

Rebases:
 - 000-cross-compile.patch
 - python-3.3-multilib.patch

(From OE-Core rev: 0a3a4047e779c8bff2b5e2bfa37b7ab119d08d4b)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Alejandro Hernandez
adf4266524 python: upgrade from 2.7.11 to 2.7.12
LICENSE did not change, only dates were changed

Rebases:
 - multilib.patch
 - 01-use-proper-tools-for-cross-build.patch

Upstream:
 - avoid_parallel_make_races_on_pgen.patch
 - CVE-2016-5636.patch

(From OE-Core rev: 2e64fdc99a0e00bd0a4b4bf09a128e56fd8e9f8b)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Alejandro Hernandez
db9508891b python-native: Upgrade from 2.7.11 to 2.7.12
LICENSE did not change, only dates changed.

Rebases:
 - debug.patch
 - multilib.patch

Upstream:
 - avoid_parallel_make_races_on_pgen.patch

(From OE-Core rev: dce8e8bb274c2f7c01dd21e1ecfd47bc3f1b4e13)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Mariano Lopez
909e2120d4 python-smartpm_git.bb: Add patch for debugging random errors
This will add a patch to debug random errors seen in the
autobuilders, it won't solve the errors, but will give us
a better idea of what is happening.

[YOCTO #8383]

(From OE-Core rev: c52a7e910a3a52a7455a2409d9ade449bbbd66d4)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Catalin Enache
1650f67230 libevent: update ptests fail condition
If exit status is 0 test is succesfull.

(From OE-Core rev: 6b91338a0c09e117cfc58084b66ffcd149765316)

Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Robert Yang
8efd482911 package.bbclass: remove unneeded chmod() and chown()
* The mode and owner info are saved in inode, hardlink won't change them,
so remove unneeded chmod() and chown().

* This can avoid the problem that when do_package re-run, the file's mode
maybe different if it is 0444 (changed to 0644 when re-run), this is
caused by pseudo adds 'w' on real file, and doesn't track linked source
when hard link, Peter and Mark may fix pseudo, but the removed code is not
needed, which can avoid the problem.

* To reproduce the problem, for example, version.c from gzip's ${B}:
1) bitbake gzip
2) Edit rpm-native or package.bbclass to make do_package re-run.
3) bitbake gzip
After the first build, build/version.c in gzip-dbg is 0444, but after
the second build, it will be 0644, this because do_package does:
$ ln ${B}/version.c gzip-dbg/version.c,
$ chmod 0444 gzip-dbg/version.c (it runs chmod 0644 on the real filesystem)
And in the second build, the gzip-dbg/version.c will be removed and
created again, so that stat() can't get 0444 but 0644 since
${B}/version.c is not tracked by pseudo.

(From OE-Core rev: 26ab4b431da0c00010e8d399f890c5fbf0b03c94)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Fan Xin
591bd6b0aa libgcrypt: upgrade to 1.7.2
(From OE-Core rev: 88abc4bc9a4e0b4d1e223827fe279b8f008af8a2)

Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Fan Xin
f157570e74 procps: upgrade to 3.3.12
(From OE-Core rev: a1ed1c6564a145f4453d389eb2357c17b71b1b79)

Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Fan Xin
69735b9586 curl: upgrade to 7.50.0
(From OE-Core rev: 638e648fdcba2f2a4fdf53747290a9a98ea0a86e)

Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:30 +01:00
Trevor Woerner
a4f0ae1113 kernel.bbclass: add lzop dependency
If the initramfs image is type lzo, then a native lzop is needed.

(From OE-Core rev: ee0640cb0c32b959ffaaac6752d582ed1d76e313)

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Maxin B. John
3b064be9b1 piglit: fix build failure with gold linker
When we use gold linker while DISTRO set to "nodistro", piglit build
fails with the following error:

| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to
'dlsym'
| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to
'dlerror'
| ../../../../lib/libpiglitutil_gl.so.0: error: undefined reference to
'dlopen'
| collect2: error: ld returned 1 exit status

Fix it by providing '-ldl' to LDFLAGS.

[YOCTO #9851]

(From OE-Core rev: 79005ff905f8c82a8766af5a927b9a0f8929e24f)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Stefan Müller-Klieser
3e97d194f8 matchbox-panel-2: remove dangling patch
(From OE-Core rev: 9b2f4dc36e9495447546d1257385e2fc8fc051b6)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Stefan Müller-Klieser
49b4df1b0c matchbox-desktop: remove dangling patch
(From OE-Core rev: 5eaafd6aea33fb104ae2c320bf972ba96f6b5c04)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Stefan Müller-Klieser
2b8dd4ce1a alsa-utils: remove dangling patch
(From OE-Core rev: 2b0f3ddda38336664c59711e6952e608b31de4bf)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Stefan Müller-Klieser
cb188dc186 python-numpy: remove dangling patch
(From OE-Core rev: de29a3974efffee6fd20126f96ed8015fe3307b9)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Stefan Müller-Klieser
fe5f80bda8 guile: remove dangling patch
(From OE-Core rev: 8086862e64281f55fc89c39e16b1e339a9174a60)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Stefan Müller-Klieser
8b88df382d openssl: remove dangling patch
(From OE-Core rev: 59ac18c5c1a60975346309f45731290a6c72c061)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Stefan Müller-Klieser
f389433b25 gstreamer1.0-plugins-bad: remove two dangling patches
(From OE-Core rev: f45c7e195b23524accd4309d49516bc44acc4a49)

Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Ross Burton
77e5a89df3 autotools.bbclass: remove intltool.m4 from ${S}
We need to ensure that builds use our intltool.m4 as there is a bug in
upstream's macros when the host doesn't have XML::Parser installed.

So generalise the m4 pruning logic that we already have from gettext and add
intltool.m4.

(From OE-Core rev: 342fa2b8407552a962e7c78d0e4de7b2d0b30041)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Ross Burton
63cb0eec1f autotools: move aclocal-copy to WORKDIR
To save time move the temporary copy of the autoconf macros, aclocal-copy, from
${B} to ${WORKDIR}.  This ensures that it can't conflict with anything in ${S}
and means the pruning code doesn't need to know about it.

(From OE-Core rev: d7249c5cce6fbc7875c46f2452ca8cd045773898)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:29 +01:00
Ross Burton
e1081f491c intltool: bump serial for aclocal --install
We modify this macro and need it to be used over local copies in tarballs.  It
appears that aclocal doesn't quite want to do the right thing just yet but
increase the version just in case it does in the future.

Upstream typically increments by one, and autoconf handles point versions fine,
so bump it by 0.1.

(From OE-Core rev: a9a7eea897e5771d1760a39150ef348911447b20)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:28 +01:00
Ross Burton
c5af7540a5 yocto-uninative: bump to uninative tarball version 1.2
This new uninative version includes fixes to use the host locales.

[ YOCTO #9994 ]

(From OE-Core rev: 114722f33830263d351e55273f17449aa112af47)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:28 +01:00
Jonathan Liu
88a3d7629c meta/classes: fix bb.build.FuncFailed typos
(From OE-Core rev: 6a8b9599945f3f57bd86a205bc107b8490518d29)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:28 +01:00
Khem Raj
30ab044dac binutils: Bump to 2.27
(From OE-Core rev: 3f1eb2556026572dca9476c561d89b86723395c7)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:28 +01:00
Aníbal Limón
26c6b10da8 apt: Fix build in musl it was break due to upgrade to 1.2.12
methods/connect.cc: Musl doesn't support AI_IDN flag in netdb.h
header so define it manually.
apt-pkg/contrib/srvrec.h: Add explicity include of sys/types.h
to avoid errors in types u_int_SIZE.

(From OE-Core rev: a088018e6e36073c0723b160f8b087a5243836ee)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:28 +01:00
Khem Raj
e884ceeaa3 glibc: Switch to 2.24 release branch
glibc 2.24 is released now
https://www.sourceware.org/ml/libc-alpha/2016-08/msg00212.html

(From OE-Core rev: 01fe48252085284e2964f5dd52b8b5fa54ee10d3)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10 10:46:28 +01:00
Ross Burton
dfc016fbf1 maintainers.inc: remove augeas
This has been removed from oe-core so we don't need to track the maintainer.

(From meta-yocto rev: a6336060e9f41323b800bffd590248e8ad131b99)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 20:56:11 +01:00
Richard Purdie
a9681ef2e3 Revert "packagegroup-core-x11-base.bb: replace pointercal with pointercal-xinput"
This reverts commit a93c45fa77eb7ea31b91d5bad3c64634bd1476ee until we merge
the rest of the pointercal patches.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 20:55:20 +01:00
Markus Lehtonen
a56fb90dc3 base.bbclass wipe ${S} before unpacking source
Make sure that we have a pristine source tree after do_unpack.

[YOCTO #9064]

(From OE-Core rev: eccae514b71394ffaed8fc45dea7942152a334a1)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:24 +01:00
Maxin B. John
3522a90f1b packagegroup-core-x11-base.bb: replace pointercal with pointercal-xinput
Replace pointercal with pointercal-xinput since we removed pointercal recipe.

(From OE-Core rev: a93c45fa77eb7ea31b91d5bad3c64634bd1476ee)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:24 +01:00
Joe Slater
574515445a dpkg: put start-stop-daemon into a separate package
This is useful for supplying start-stop-daemon to
images that do not include busybox.

(From OE-Core rev: b1e439a046e0cd48709fb2ee33cafa9fe23284be)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:24 +01:00
Dengke Du
7759b4844f perf: enable man pages for 'help' functionality
When using 'perf help <subcommand>', it can't find 'man' command and pages for
perf.
The perf man pages depends on the xmlto-native and asciidoc-native, so we just
need to add the two packages to the DEPENDS variable and add 'man'to
RDEPENDS_perf-doc.

(From OE-Core rev: bbff6b07256d63d318066eb1357763467532dd70)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:24 +01:00
Robert Yang
9ddb513a7f create-pull-request: set subject automatically for cover latter
Set cover letter's subject automatically as the patch's subject when
there is only one patch.

[YOCTO #9410]

(From OE-Core rev: 162b80f8a4670befaf6ffd2c178671cf7370b767)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:24 +01:00
Robert Yang
1d7228c565 create-pull-request: read remote from env var CPR_CONTRIB_REMOTE
So that we don't have specify "-u <contrib>" everytime, and
CPR_CONTRIB_REMOTE can be overrided by -u.

[YOCTO #9409]

(From OE-Core rev: 81c58fd33e725ce7dba693763646f4c30747bbd5)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Robert Yang
a15826520f create-pull-request: add option -a to auto push
Before this patch, we need two steps to create PULL:
* Step 1, create branch:
  $ git push <contrib> <local_branch>:<remote_branch>
* Step 2, create PULL:
  $ create-pull-request -u <contrib> -l <local_branch> -b <remote_branch> -r <local_branch>~<n>

We can see that the args used in step 1 are in step 2, so we can use
"create-pull-request -a" or set CPR_CONTRIB_AUTO_PUSH in to create the
branch to simplify the steps.

[YOCTO #9408]

(From OE-Core rev: a569bec9219394703d1c1d9b28dd19bf5b058e7f)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Alejandro Hernandez
ca5645901b cronie: upgrade to 1.5.1
(From OE-Core rev: a3f60d365e7ff20a1ad0875375b083a5baaaf9f1)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Dengke Du
1580eac758 Asciidoc: add it
In order to enable perf man pages for basic 'help' functionality,
it needs to produce man pages for perf, which depends on the xmlto
and asciidoc tools.
So add the asciidoc recipe to help produce man pages for perf and
other commands.

(From OE-Core rev: 1f57ac3b10df184d5ce992297ec0626895174ec9)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Ross Burton
a5eb998c4d augeas: remove from oe-core
Nothing in oe-core uses this, so it's been moved to meta-oe.

(From OE-Core rev: 89cafc6dcf6425c2e33270dac37f7649ccbffa33)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Robert Yang
9ac1500789 tcl: 8.6.5 -> 8.6.6
Updated no_packages.patch.

(From OE-Core rev: 46107be8fe6d9367adf6e391028fe5f836f82ed6)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Robert Yang
46d59011cb strace: 4.12 -> 4.13
Updated Makefile-ptest.patch

(From OE-Core rev: 56d3ead9da83e1116c5c6e78441275e079e466b2)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Robert Yang
7dbfe6f73d libcap-ng: 0.7.7 -> 0.7.8
(From OE-Core rev: 74252ed1c377d200c8e398d8a00f39cab17e170c)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
mingli.yu@windriver.com
1f1ac9fbda grub2.inc: run autogen.sh before configure
* When adding new source files from upstream the autogen.sh
  script needs to be run
* Rework grub2-remove-sparc64-setup-from-x86-builds.patch
  to remove the grub-setup helper program grub-sparc64-setup
  in Makefile.util.def instead of the previous Makefile.util.am
  to avoid the update for Makefile.util.am in do_patch phase is
  overwritten by the autogen.sh in do_configure phase

(From OE-Core rev: 949df030cf39e7f551302e1e6f86b0a270cd2181)

Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Mariano Lopez
37f1e0c154 oeqa/utils/sshcontrol.py: Allows to copy symlinks to target
Currently when copying a symlink to the target it will fail
throwing an exception. This will recreate symlinks from the
system performing the tests to the device under tests.

[YOCTO #9932]

(From OE-Core rev: 5705b7a55bc300e14c34b0530f4d49df101edd3c)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:23 +01:00
Mariano Lopez
65459f5b6d oeqa/oetest.py: Allow to export packages using symlinks
Currently packages that contains symlinks can't be extracted
and exported. This allows to export extracted such packages.

A nice side effect is improved readability.

[YOCTO #9932]

(From OE-Core rev: 0338f66c0d246c3b8d94ac68d60fbc4c314e500b)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Mariano Lopez
65a03c3f94 oetest.py: Remove check for __init__.py
When using "auto" in TEST_SUITES there is a check
for __init__.py in the <layer>/lib/oeqa/runtime/
directory in all the layers in BBLAYERS.

This check was needed because the way that python 2
import the modules, now that bitbake uses python 3
there is no need these __init__.py files, moreover
these files won't allow to import tests from other
layers.

This patch removes the check.

[YOCTO #9996]

(From OE-Core rev: f1cc272e4851fd994e9d052628a747ac19f90488)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Mariano Lopez
84d854c98b oetest.py: Add command line parameter support for tag in testexport
This allows to use a command line argument to change the
tag used to filter test instead of rebuilding the tests.

[YOCTO #8532]

(From OE-Core rev: 928e0eecdb126f7d0bacd05b7057fc825e0d8f05)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Jeremy Puhlman
2d565fae46 bitbake.conf: set READELF for cross compilation
In the case of using an external toolchain that supports multilib
compilation with a single binary, TARGET_PREFIX is the same for both main
and multilib abis. Without READELF exported, python3 assumes it is
either the readelf for ${BUILD_SYS}-readelf. Exporting cross readelf
fixes the build issue.

checking LDLIBRARY... libpython$(LDVERSION).so
checking for i586-montavistamllib32-linux-ranlib...
x86_64-montavista-linux-ranlib
checking for i586-montavistamllib32-linux-ar...
x86_64-montavista-linux-ar
checking for i586-montavistamllib32-linux-readelf... no
checking for readelf... readelf
configure: WARNING: using cross tools not prefixed with host triplet

(From OE-Core rev: 3442ee423813d547be7899a25ea31efe719e662f)

Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Jeremy Puhlman
8b5f369726 Fix random python backtrace in mutlilib handling code.
newval is not defined in all cases. Set to None and check if it is set.

  File
"/local/foo/builds/x86/layers/openembedded-core/meta/classes/multilib_global.bbclass",
line 90, in preferred_ml_updates(d=<bb.data_smart.DataSmart object at
0xf6fd528c>):
                 if not d.getVar(newname, False):
    >                d.setVar(newname, localdata.expand(newval))
             # Avoid future variable key expansion
UnboundLocalError: local variable 'newval' referenced before assignment

(From OE-Core rev: 25ebd3bbc1f9f4b1b6147d98dd43690c3bf03ee7)

Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Mariano Lopez
44ae8284d0 selftest/runtime-test.py: Add test for testexport SDK feature
This adds test_testexport_sdk() to test the SDK feature
of testexport in the CI in order to avoid breaking it.

[YOCTO #9765]

(From OE-Core rev: badec3d10fcdd2d000450ab533caadcff1df5e13)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Dai Caiyun
d2e5c93dba dhcp: dhcrelay.service cannot start successfully
Modify dhcrelay.service to avoid it start failed.

(From OE-Core rev: f0ee1778c99a8b40c0fefa5f846aa34bf9701008)

Signed-off-by: Dai Caiyun <daicy.fnst@cn.fujitsu.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Ross Burton
43a3933624 meta: add more missing patch tags
(From OE-Core rev: 5e5a6145d844c2f6daa3258429a870c42475adff)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Ross Burton
6d59c5cd61 cml1: fix tasks after default [dirs] changed
These tasks relied upon [dirs] being ${B} by default.  As the functions are not
simple, add back [dirs] so they work again.

[ YOCTO #10027 ]

(From OE-Core rev: 614d976ee97d6386c37afb54add5b83741ca401e)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Jacob Kroon
c00346d80f bitbake.conf/toolchain-scripts.bbclass: Remove debug prefix mappings in SDK
CFLAGS/CXXFLAGS in the SDK environment script adds debug-prefix mappings
that include staging area/work directories. Remove them since the SDK
shouldn't be aware of them.

(From OE-Core rev: 7918e73e9c5fe8c8c1c1d341eaa42f2f7d3ddb69)

Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Joshua Lock
6cfd86ff2f pseudo: update git recipe to include xattr perf fix
Update the SRCREV to 2 commits beyond the 1.8.1 tag (to the current
HEAD) in order to include a fix for the xattr performance regression
[YOCTO #9929].

(From OE-Core rev: 94eb2552cdcbe99ba684780c9a6fbbbe7328c906)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:22 +01:00
Joshua Lock
2726f91d41 pseudo: backport patch to fix xattr performance
In the 1.8 series of pseudo extended attribute handling was reworked
to be a property of inodes, not paths, and as a product fixed extended
attribute semantics on hardlinks. Unfortunately this rework introduced
a slow path around file deletion.

Add a patch for use by the pseudo 1.8.1 recipe which backports a fix
for this regression from the master branch of pseudo.

[YOCTO #9929]

(From OE-Core rev: 75627af164f027de0036b91854e9b926de786bcd)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Khem Raj
d4040da8bc mesa: Fix build when cross compiling with clang
(From OE-Core rev: 69e9b190ff0e8b963bbaea8365917218cf3c2558)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Khem Raj
50008ffeb9 gstreamer1.0-plugins-bad: Backport GstGLMemoryEGL implementation
Backports fix for
https://bugzilla.gnome.org/show_bug.cgi?id=760916

(From OE-Core rev: 3715cdec309b5b62035798e77a9a77b98a9f779a)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Khem Raj
a09a7b71ce gdb: Cache gnu gettext config vars for musl builds
intl is used in gdb as well and we run the configure for
it when running do compile. So we need to insert these
caching of variables to extra oe_make

(From OE-Core rev: 60de4d6c717c6a5131b02de29234d53a6ca1b993)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Khem Raj
76fc5ab81d ffmpeg: Upgrade to 3.1.1
Fix build on mips64 while on it.
It was failing for mips64 with 3.1 too

(From OE-Core rev: e6e228b36f2603540d33b06f515aed7d2f5b8a6d)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Aníbal Limón
8b21a516b0 apt: Upgrade to 1.2.12
Test was made building core-image-sato with package_deb on qemux86 and
qemuarm then run for two of them testimage and install packages with
apt-get using PACKAGE_FEED_URI's configuration.

Now apt support drop priviligies for install packages using a sandbox
with _apt user, the useradd class was inherit and configured to install
_apt user and group.

Rebased patches:

	- 0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
        - 0001-fix-the-gcc-version-check.patch
	- 0001-remove-Wsuggest-attribute-from-CFLAGS.patch
	- disable-test.patch
	- no-curl.patch

(From OE-Core rev: 369a7f7232aa8406b63376f7888896fe90f9ce40)

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>
2016-08-04 15:22:21 +01:00
Hongxu Jia
564657edae groff_1.18.1.4: fix narrowing conversion error
While gcc6 used, build old groff (for anti-GPLv3 reasons) failed:
.....
|groff-1.18.1.4/src/devices/grolbp/charset.h:69:1: error: narrowing
conversion of '130' from 'int' to 'char' inside { } [-Wnarrowing]
......

In upstream git://git.savannah.gnu.org/groff.git,
the following commit fix the issue, but the license is GPLV3,
we could not backport it to the old groff which license is GPLV2.
...
commit d180038ae0da19655bc2760ae2043efa0550a76c
Author: Werner LEMBERG <wl@gnu.org>
Date:   Wed Apr 16 21:11:07 2003 +0000
    * src/devices/grolbp/charset.h (symset): Use `unsigned char'.
...

We use another different way to fix the issue.

[YOCTO #9896]

(From OE-Core rev: 0d79e7b4373053a7f20f18ed962c5a17a969e57e)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Alejandro Hernandez
b37463b6de python-pexpect: Upgrade to 4.2.0
LICENCE checksum changed, although license didnt change,
it says PEXPECT license instead of ISC, but its still ISC.

(From OE-Core rev: e4fefccf03bb1e588468757d0fbe42f0704206d2)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Maxin B. John
1e555c0d06 glew: upgrade to 2.0.0
1.13.0 -> 2.0.0

v2:
        Fix installed-vs-shipped QA error for multilib build

(From OE-Core rev: 71d66d419358f43e6b044ba64c8ff4a6830b00e4)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Maxin B. John
d753c91c4e apmd: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian.

So, move all of SRC_URI to the .bb so it can use snapshot.debian.org
instead, and set UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream
release checking continues to work.

v2:
        use ${BPN} instead of ${PN} in SRC_URI for multilib builds

[YOCTO #10040]

(From OE-Core rev: 6756bdb86a6e52eff0a269d441d76ecc2353a06e)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:21 +01:00
Bruce Ashfield
a996ae6228 linux-yocto/4.1: qemuppc and qemumips build fixes
The v4.1.28 -stable update broke the build for some ppc and mips
platforms. We fix the errors by backporting a missing commit for
ppc:

  powerpc/tm: Abort syscalls in active transactions

And by reverting a commit for mips (rather than backporting more
changes to -mm):

  Revert "MIPS: Reserve nosave data for hibernation"

(From OE-Core rev: 02a1d6eb52b78c7fdcfe2a64e427488e6dd9ce4d)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:20 +01:00
Bruce Ashfield
453c174e41 linux-yocto/4.1: bug fixes and configuration changes
Integrating the following two commits:

  44af90071620 4.1.28 Fix bad backport of 8f182270dfec "mm/swap.c: flush lru pvecs on compound page arrival"
  99c37e1500a6 i2c: ismt: Add Intel DNV PCI ID

And the following two meta-data changes:

  afbc6bd00e6f bsp/axxiaarm64: Enable Axxia NCR and PEI drivers
  6a2047c00450 common-pc: enforce 32 bit

(From OE-Core rev: d52e523b28cc95a741039018d76fa4c1a947a40f)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:20 +01:00
Bruce Ashfield
9dc4cfc54d linux-yocto/4.1: bump to v4.1.28
Updating the 4.1 kernel to the korg -stable release

(From OE-Core rev: 3d888fa7b27865b5fc1b6ee5e138692847648f40)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-04 15:22:20 +01:00
Scott Rifenbark
a3cad8f0e0 bitbake: bitbake-user-manual: Applied typo fix to "Override Style Operation Advantages"
Fixes [YOCTO #9985]

Fixed an operator typo from ":=" to "+=" in the note
at the bottom of the section.

(Bitbake rev: 319d3d387161182069e6d1b3db17ccb539d097ed)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark
ae427fb097 bitbake: bitbake-user-manual: Changed bitbake command example.
Fixes [YOCTO #7718]

In the "Executing a List of Task and Recipe Combinations"
section, I changed the improper bitbake command example to
use the correct syntax.  This change was review feedback.

(Bitbake rev: c79fab1be4898ec88bfddd4c4f84e76dc3a3125b)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark
e205789361 bitbake: bitbake-user-manual: Updated the PROVIDES variable
Fixes [YOCTO #10011]

Added paragraphs near the end to describe the role of virtual
targets.

(Bitbake rev: fc47bb99dbc1972dfb3a83c0f4c479963da64bcc)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark
f0e73a4b65 bitbake: bitbake-user-manual: Added non-existant variable expansion
Fixes [YOCTO #10003]

I added a small paragraph explaining what happens when expansion
of a variable that does not exist occurs.

(Bitbake rev: 8006da3f229d0227215ccd59cd273edacf72f9ce)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark
41b49cadd3 bitbake: bitbake-user-manual: Applied some review comments
Fixes [YOCTO #9985]

Fixed some problems with the changes.  A small typo for an
example and added a clarifying operator in another sentence.

(Bitbake rev: d8ae3775eefe3f7b62fc26cae5b742ae83850c13)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark
a3a7ddf120 bitbake: bitbake-user-manual: Updated the "Inline Python Variable Expansion" section.
Fixes [YOCTO #9984]

Added a small note to the bottom to help clarify.

(Bitbake rev: 64bf49826088c56b739ed971251f05b4564c712e)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark
eb282b797e bitbake: bitbake-user-manual: Fixed override operator syntax.
I had inconsistent usage of the "_append" style operator syntax
in the chaper.  I was using a mix of <filename>_append</filename>
and "_append".  I changed to "_append" for consistency.

(Bitbake rev: 5c5b88e402376268baa15c5d04d2592f28d76751)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark
6aaf379119 bitbake: bitbake-user-manual: Clarified override-style operators.
Fixes [YOCTO #9985]

Made the following changes:

 * Section Removal (Override Style Syntax):  Added a small
   qualifying sentence at the end to further define behavior

 * Added new section "Override Style Operation Advantages":
   This section provides some rationale behind the "_append"
   style operations.

 * Section "Examples": Changed an example to use the "="
   operator rather than the "+=" operator.

(Bitbake rev: 797d9627baad9ccd3d55e825c0d705311f631f78)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:15 +01:00
Scott Rifenbark
d1e3f0bb16 bitbake: bitbake-user-manual: Updated the variable expansion section.
Fixes [YOCTO #9984]

Added more detail to the examples that show the effects of
variable expanison.

(Bitbake rev: 480096ca93c0a649ebfff68dfc7d9bbe8eb2ea2d)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:22:14 +01:00
Richard Purdie
2652217970 bitbake: Revert "bitbake-user-manual: Added new section on command-line execution"
This reverts commit 6f6cd0674fd1595f4e74b7da692e0c348b2660c6 as it was
a duplicated commit.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-02 15:21:46 +01:00
Scott Rifenbark
5203cfe6a9 ref-manual: Removed redundant "and"
(From yocto-docs rev: 60a1b98e22d4118e090c0dd214736b78884da227)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:01 +01:00
Scott Rifenbark
2322267e24 ref-manual: Removed stray parenthesis.
Fixes [YOCTO #9988]

(From yocto-docs rev: 314f3c10e420a9681b4a814ddc4f24bbddd3741a)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:01 +01:00
Scott Rifenbark
566ebc1af2 ref-manual: Updated the STAGING_DIR_HOST variable.
Fixes [YOCTO #9988]

Added a link to the MULTIMACH_HOST_SYS variable from the
STAGING_DIR_HOST variable where it is referenced.

(From yocto-docs rev: 0f72b58a7bc1271245d139726f1145d5d99acee4)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:01 +01:00
Scott Rifenbark
4396ffb3c9 ref-manual: Updated STAGING_DIR_TARGET and MULTIMACH* variables.
Fixes [YOCTO #9988]

Updated the STAGING_DIR_TARGET variable with a better introductory
sentence.

Updated the MULTIMACH_TARGET_SYS variable with a more expanded
explanation.

Added a new glossary entry for the MULTIMACH_HOST_SYS variable.

(From yocto-docs rev: d17873d695772b62325de35dd0e5b9ccc7f12f1a)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:01 +01:00
Scott Rifenbark
05beac3ef0 ref-manual: Added a link to D variable and moved a task:
Fixes [YOCTO #9989]

Added a link to the WORKDIR term in the D glossary description
example.

Also, moved the do_checkpkg task from the section of showing
normal recipe build tasks to the the section for manually
called tasks.

(From yocto-docs rev: 548e2fdfeae9d67bbad73ee3ab69a64a9a6ce9ff)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:01 +01:00
Scott Rifenbark
376a8201d1 ref-manual: Augmented some STAGING_DIR_* variable descriptions:
* Updated the STAGING_DIR_HOST description
 * Updated the STAGING_DIR_NATIVE description
 * Updated the STAGING_DIR_TARGET description

Fixes [YOCTO #9988]

(From yocto-docs rev: cc2c3d849f0919199d1b7960e30ed152f3f0474e)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
599be67eef Revert "ref-manual: Added new glossary entry for REMOVE_PKG_SUPPORT."
This reverts commit 95b740d719a7a6ffe3a06a1f152af4d877ee08c7.

I inadvertantly put this variable description in before they had
settled on it.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
33b01c502f ref-manual: Added 3 new QA sanity checks.
Fixes [YOCTO #9983]

Added the host-user-contaminated, invalid-chars, and invalid-packageconfig
QA checks.

(From yocto-docs rev: 5bd28f9386a8afff435254788fbce73a7fc48305)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
f2fa3c59bb ref-manual: Applied review edits to "Checking for Missing Build-Time Dependencies"
Removed an errant comma and rewrote the final area of the section.

Fixes [YOCTO #9976]

(From yocto-docs rev: 19924dee2ebec3ff2a53152ecb8f79172eb43060)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
7c5a147141 ref-manual: Applied review changes to the do_deploy task.
Cleared up the last third of the description with better structure
and wording.

Fixes [YOCTO #9970]

(From yocto-docs rev: a2dbea4f3bbdddd72c86a5ade86ac822cd9bfecd)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
c9e3815b2e ref-manual: Added new "Checking for Missing Build-Time Dependencies" section.
I added a new suggest section to the existing "Debugging Build
Failures" section.  This section describes how to check for
build-time dependencies.

Fixes [YOCTO #9976]

(From yocto-docs rev: 54cd7161593ba35b63a26ade312cc4aee17e3515)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
fa0c574deb ref-manual: Added link to the do_populate_sysroot task
Fixes [YOCTO #9968]

Made a link for the STAGING_DIR_HOST variable for consistency.

(From yocto-docs rev: eeb163ead40752d69f2f6c19e859e82109ef967d)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
6c302a4250 ref-manual: Applied formatting to QA check string in do_install task
Fixes [YOCTO #9966]

(From yocto-docs rev: ae87d07c8d429813d30569360eb4889eac398bee)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
38c33b7904 ref-manual: Fixed output example in the B variable.
Updated the example statement line to match the actual assignment.

(From yocto-docs rev: 45e9274fcca0a285bda38cad8a6fe5e7bb05bd80)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:15:00 +01:00
Scott Rifenbark
30929cf037 ref-manual: Updated the do_deploy task reference section.
Fixes [YOCTO #9970]

Added more detail to the do_deploy task.

(From yocto-docs rev: 1b2daf814011dbc3c5987313442e95e18e83e180)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:14:59 +01:00
Scott Rifenbark
bc14368d39 ref-manual: Added detail to the populate_sysroot task.
Provided more detail in the first sentence.

Fixes [YOCTO #9968]

(From yocto-docs rev: 15080a565bafdfffe0c13a0a18fd1c011773cc25)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:14:59 +01:00
Scott Rifenbark
bb1643444e ref-manual: Updated the do_packages task.
Fixes [YOCTO #9967]

Added more detail to this task description.

(From yocto-docs rev: 8cb154493a6b4ee541826f898b823a4dc2795f88)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:14:59 +01:00
Scott Rifenbark
4f27aa6e3a ref-manual: Updated the do_install reference section.
Fixes [YOCTO #9966]

Added quite a bit of detail to this task's description.

(From yocto-docs rev: c29d86813b9cb9bc1c9c02aeffb5cfd99fc5a542)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:14:59 +01:00
Scott Rifenbark
781bff802b ref-manual: Updated the do_configure task.
Added more detail for this task.

Fixes [YOCTO #9965]

(From yocto-docs rev: e50207488b8262bb46e58c4b9f40e487c15abc67)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:14:59 +01:00
Scott Rifenbark
8f2d8c2061 ref-manual: Fleshed out the do_compile task.
Fixes [YOCTO #9964]

Added more detailed information to the do_compile task.  Also, provided
some information about oe_runmake in the base.bbclass refrence.
Finally, put some detail in the "Shared State" section concerning
do_deploy[dirs].

(From yocto-docs rev: 5d0612a57cc8e035a2194ada21e65055ef2b8a2e)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:14:59 +01:00
Scott Rifenbark
04c611290c ref-manual: Updated RDEPENDS variable description with note.
Fixes [YOCTO #9963]

I created a new cautionary note to warn the user to use the correct
operator "+=" rather than "=" so that they do not destroy $PN.

(From yocto-docs rev: e6861ffe9400b1ee48cc46ccfc6e8d65efbbec8c)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:14:59 +01:00
Scott Rifenbark
818e439cf5 ref-manual: Applied review comments to logging mechanism section
Fixes [YOCTO #9950]

I Provided a suggested introductory sentence and a better link to
the logging.class file, which is near the end.

(From yocto-docs rev: 6f296266b35f17792510d6a01f5640ba30818a22)

Signed-off-by: Scott Rifenbark <srifenbark@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:14:59 +01:00
Armin Kuster
2db1d3b76d foomatic-filters: Security fixes CVE-2015-8327
CVE-2015-8327 cups-filters: foomatic-rip did not consider the back tick as an illegal shell escape character

(From OE-Core rev: 986f7fbe37a48d050611f08f7160ed96755ac3dc)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:11:21 +01:00
Armin Kuster
e07ebd001b foomatic-filters: Security fix CVE-2015-8560
CVE-2015-8560 cups-filters: foomatic-rip did not consider semicolon as illegal shell escape character

(From OE-Core rev: 94d89ab75efbac4486c581a53cbd90e843c3fde4)

Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 12:11:20 +01:00
Maxin B. John
f5a7cd40f0 at: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian. So, move all of
SRC_URI to use snapshot.debian.org instead, and set UPSTREAM_CHECK_URI
to ${DEBIAN_MIRROR} so upstream release checking continues to work

[YOCTO #10005]

(From OE-Core rev: 088c82bb553888759cf631e726a521a3394269c7)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Maxin B. John
eef97b3a54 mailx: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian.

So, move all of SRC_URI to the .bb so it can use snapshot.debian.org
instead, and set UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream
release checking continues to work.

[YOCTO #10040]

(From OE-Core rev: 90abbe6c35b8ea66d984bc954405cf12787a919c)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Maxin B. John
27b49de75d libaio: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian.

So, move all of SRC_URI to the .bb so it can use snapshot.debian.org
instead, and set UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream
release checking continues to work.

[YOCTO #10040]

(From OE-Core rev: 9e6e7b3a573446808d0aa9d82bedfb386b0aef93)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Maxin B. John
1a740c6ac3 blktool: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian.

So, move all of SRC_URI to the .bb so it can use snapshot.debian.org
instead, and set UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream
release checking continues to work.

[YOCTO #10040]

(From OE-Core rev: 3b6d9a6636efa4ae49d494b48021555344bdae1e)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Maxin B. John
ecde311ccd serf: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian. So, move all of SRC_URI
to the .bb so it can use snapshot.debian.org instead, and set
UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream release checking continues
to work.

[YOCTO #10040]

(From OE-Core rev: 0cf90e6f1fa6b3a82f8b914b7717a3250ad0c9e4)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Maxin B. John
5727f465a6 linuxdoc-tools: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian. So, move all of SRC_URI
to the .bb so it can use snapshot.debian.org instead, and set
UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream release checking continues
to work.

[YOCTO #10040]

(From OE-Core rev: 8ad47832131014843e948e7d1a1aee4cd5f7a27a)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Maxin B. John
9cfb420174 docbook-xml-dtd4: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian. So, move all of SRC_URI
to the .bb so it can use snapshot.debian.org instead, and set
UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream release checking continues
to work.

[YOCTO #10040]

(From OE-Core rev: 7a548436f748600fc6bd784d1ab9bcd7518a6272)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Maxin B. John
df4451c819 netbase: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian. So, move all of SRC_URI
to the .bb so it can use snapshot.debian.org instead, and set
UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream release checking continues
to work.

[YOCTO #10040]

(From OE-Core rev: edec2f2de186bd20fe328fd590301495149350d4)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Maxin B. John
f6e53accbd ossp-uuid: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will
only contain releases that are currently in Debian. So, move all of SRC_URI
to the .bb so it can use snapshot.debian.org instead, and set
UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream release checking continues
to work.

[YOCTO #10040]

(From OE-Core rev: 1b38ad4cb8faeb86c5e8cb6b7201194722c5ef31)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Bruce Ashfield
0966a839ac linux-yocto/4.4: update to -r19
It was pointed out that the 4.4 version of -rt was lagging. I had done
the work some time ago, but didn't complete the testing effort.

I've now built and booted this on x86 and built it for ARM.

Two branches are available: standard/preempt-rt/base and standard/preempt-rt/rebase.

(From OE-Core rev: bb2ac258a80590a1c965b5da939d6531b3f2098a)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
André Draszik
2c358b9385 readline: don't install readline C examples
They are unlikely to be of any use in the target file system.

(From OE-Core rev: 5889583b3961bf09ae32418777b06db3a02816b1)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:14 +01:00
Patrick Ohly
a9aef4087b useradd-staticids.bbclass: trigger reparsing when table files change
This addresses (among others) the following problem:
- USERADD_ERROR_DYNAMIC=error causes a recipe to get skipped
  because a static ID entry is missing
- the entry gets added to the file
- using the recipe still fails with the same error as before
  because the recipe gets loaded from the cache instead
  of re-parsing it with the new table content

(From OE-Core rev: 799c93592a9aac571d6dc05529437c0eec7b08b8)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:13 +01:00
Aníbal Limón
1981ab0829 oeqa/utils/commands.py: Command class improve validations/decoding in output
When run a command sometimes the output isn't provided so validate
before trying to encode to utf-8, also some output like BIOS/EFI
contains characters that can't be codified into utf-8 for this reason
set errors='replace'.

[YOCTO #10019]

(From OE-Core rev: f2a04faf3c5d0a3cc562061b22e1c4873e1ca769)

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>
2016-08-01 11:47:13 +01:00
Aníbal Limón
1648504198 oeqa/runtime/syslog: test_syslog_logger Don't try to use logread when systemd is enabled
Busybox logread uses shmmem circular buffer to retrive [1] syslog messages
when systemd is enabled this shmem circular buffer isn't enabled because
systemd journald doesn't provide it.

[1] https://git.busybox.net/busybox/tree/sysklogd/logread.c?id=accd9eeb719916da974584b33b1aeced5f3bb346#n121

(From OE-Core rev: f49e4847ba00cdd072e5f072cb9ca69ef98af758)

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>
2016-08-01 11:47:13 +01:00
Aníbal Limón
a86a1b2703 classes/testimage: When image is systemd, enable debug log level
In order to get more information about systemd boot process to
be able to debug random failures due to high I/O.

[YOCTO #9299]

(From OE-Core rev: a0bb64973e767c3b8e0bae18ee84ed92693922f0)

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>
2016-08-01 11:47:13 +01:00
Aníbal Limón
140f6c7308 busybox-syslog.default: When systemd is enabled don't use circular buffer
Busybox syslog uses a shmmem circular buffer [1][2] when launch with -C option
when systemd (is enabled) takes the control of syslog messages and then forward
the messages to busybox syslog daemon, systemd journald don't usage of shmmem
circular buffer.

If -C is specified busybox-syslog never be able to read the forwarded
messages from systemd journald and don't wrote it to /var/log/messages.

This file is only installed when systemd is enabled [3].

[1] https://git.busybox.net/busybox/tree/sysklogd/syslogd.c?h=1_24_stable#n464
[2] https://git.busybox.net/busybox/tree/sysklogd/logread.c?h=1_24_stable#n82
[3] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-core/busybox/busybox.inc#n295

(From OE-Core rev: 07ea6b5fb1eae175e18ecdab3ca37304215cd428)

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>
2016-08-01 11:47:13 +01:00
Aníbal Limón
b4ba36a9d7 oeqa/runtime/syslog.py: Improve test_syslog_logger
Instead of make all the testing in a shell one liner, divide the
test into 3 operations to be able to know in what part is failing.

Parts,
	- Log message to syslog
	- Review if message exist in /var/log/messages
		- Review if message exist using logread

(From OE-Core rev: f3fe3590e887ee311f23723103eca41dcf58aa8b)

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>
2016-08-01 11:47:13 +01:00
Edwin Plauchu
8b3f624549 xorg-xserver: upgrade xserver version from 1.18.3 to 1.18.4
From version 1.18.3 to 1.18.4 modesetting driver has suffered several changes.
One of this changes allow mouse works as expected with xf86-video-modesetting
driver when system startup upon beaglebone.

[YOCTO #9828]

(From OE-Core rev: 86f016a1a6140e5ef6e9bdb64dd093744eb549ab)

Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:13 +01:00
Tim Orling
0ec45e90bd tcf-agent: update to 1.4_neon_bugfix branch
(From OE-Core rev: 3e0de80e8157669803df74a7ff06eea4d3a5d7ff)

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:13 +01:00
Alejandro Hernandez
3286f4feae python-git: Upgrade python-git and python3-git to 2.0.7
(From OE-Core rev: 48e39a78e68327a1ad2e7e5cb35e8b5dd1060b30)

Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:13 +01:00
Upgrade Helper
d8cff60677 python-numpy: upgrade to 1.11.1
(From OE-Core rev: 92396af29ed8101a811f05654d15f8bc952f258c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:13 +01:00
Bruce Ashfield
5c2bc4d63a linux-yocto/4.4: mousedev and printk configuation streamlining
Integrating two changes to the 4.4 kernel:

mousedev: fix warning err caused by __cpu_to_le16p()

    mousedev: fix warning err caused by __cpu_to_le16p()

    following warning msg is found when compiling the kernel for qemumips:
    .../drivers/input/mousedev.c:749:15: warning: passing argument 1 of
    '__cpu_to_le16p' from incompatible pointer type [-Wincompatible-pointer-types]

    convert the function's parameter to (__u16 *) to fix this warning.

    Signed-off-by: Zhenbo Gao <zhenbo.gao@windriver.com>

printk.scc: don't include kernel-debug.scc

    There is no need to include kernel-debug.scc into printk.scc as
    options from printk.cfg don't depend on CONFIG_DEBUG* options from
    kernel-debug.cfg

    Moreover, enabling CONFIG_DEBUG* options makes kernel much bigger,
    increases build time and consumed a lot of additional disk space.

    Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
    Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>

(From OE-Core rev: 711274efbbf9a750a740065c1a538217a4f3fba3)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Bruce Ashfield
e647fe0bff linux-yocto/4.4: lx-dialog and mei bug fixes
Integrating the following changes, that resolve issues with previous
functionality merges:

  ddab24299940 mei: drop wr_msg from the mei_dev structure
  26e282c0686e lx-dialog: fix merge issues

(From OE-Core rev: 84dbace51d86efcaa50c1b0cbc4d44ac884f26fc)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Bruce Ashfield
ec31f30a6e linux-yocto/4.4: bump to v4.4.15
Updating the 4.4 kernel to take the korg -stable release.

(From OE-Core rev: 605e7b4bfa766fb9db187586a06542e8af44a4c5)

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Jackie Huang
6d2987cc86 systemd-boot: use lnr instead of ln --relative
Use lnr instead of "ln --relative" as systemd does
to avoid needing coreutils 8.16.

The patch is from systemd recipe and is rebased
so it can be applied for systemd-boot.

(From OE-Core rev: 7acc8c456fee53bf637fe08e492dd5466998c585)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Ross Burton
215687eb55 gstreamer1.0-plugins-bad: add missing wayland-native dependency
The wayland support requires wayland-scanner, so add a dependency on
wayland-native.

(From OE-Core rev: 951417b7a3a6388ddb0e9d89802e50d60f02e146)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Mariano Lopez
f31683d5ba selftest/runtime-test.py: Add test for import test from other layers
There are some features in testimage/testexport that are not tested;
this might lead to break some of these features without notice.

This adds a new test in order to test two features of testimage:
  - Import test from other layers.
  - Install/Unistall in the DUT without a package manager.

[YOCTO #9764]
[YOCTO #9766]

(From OE-Core rev: cffab2257dacfa741c64611dfdf361f77aff9460)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Maxin B. John
36b3e58e3d cmake: upgrade to 3.6.1
3.5.2 -> 3.6.1

(From OE-Core rev: 3c41b239991baff2bb1facc1e9973c95c9328175)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Maxin B. John
8c6371f803 libassuan: upgrade to 2.4.3
2.4.2 -> 2.4.3

(From OE-Core rev: 2b119c05923e5ecf0338b4ddade07944b13743d1)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Maxin B. John
e7a0997f19 libgpg-error: upgrade to 1.24
1.23 -> 1.24

(From OE-Core rev: 4e951b202a5cc2c8d734a9082389435265213be2)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Maxin B. John
3486b729b2 dropbear: upgrade to 2016.74
2016.73 -> 2016.74

(From OE-Core rev: 1513e77d3f7ea9910d6ac8aab7a2f38dd6c7cd24)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Maxin B. John
f55bf4e07e wayland-protocols: upgrade to 1.5
1.4 -> 1.5

(From OE-Core rev: af9cf064f98fe106a81d90a4033c11bb1c06e19f)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:12 +01:00
Maxin B. John
0ef807a79c libtasn1: upgrade to 4.9
4.8 -> 4.9

(From OE-Core rev: 7ad0009d9282bd2af15b8b5d26a20a321cab0a32)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Maxin B. John
c90d7999d9 libsolv: upgrade to 0.6.23
0.6.22 -> 0.6.23

(From OE-Core rev: 55fa3dab693cd1ebb37330fc1faead3402ac23c9)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Maxin B. John
75efb26f76 connman: upgrade to 1.33
1.32 -> 1.33

(From OE-Core rev: 5bdc7dd6a17e217abed14d00d77c4447b2568d19)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Robert P. J. Day
081acd5a73 update-rc.d: Correct trivial typo in DESCRIPTION line.
"utilities" -> "utility"

(From OE-Core rev: 7a9473998d848fcd179df210deb3ffadccf23aba)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Khem Raj
556059a5cb binutils: Cache gettext api version 1 and 2 support
Problem described here

https://lists.gnu.org/archive/html/bug-gettext/2015-11/msg00012.html

gettext does not detect the gettext support in libc
correctly if the libc is not glibc. Musl does support
the gettext version 1 and 2 of APIs

http://www.openwall.com/lists/musl/2015/04/16/3

tests in gettext.m4 however fail since it pokes at glibc
internal symbols to determine the gettext APIs
musl's implementaitons are done differenty so the
tests fail and hence it does not enable  the libc
implementation. Since we install the header from
libc it confuses the compilation and results in errors
like

libbfd.so: undefined reference to `libintl_dgettext'

see
http://savannah.gnu.org/bugs/?46436

binutils need these variables in make env since
binutils build system runs configure in the sub directories
during make step, so we need to pass these flags
in compile step in addition to configure step

(From OE-Core rev: 21bba0548463f277684cc52d23194ad6d7c17956)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Ross Burton
8ab6c4acf3 menu-cache: remove spurious dependency on intltool
(From OE-Core rev: 3f0aea24d8460e3976e8f1db0ba694225f8bd88b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Ross Burton
6f1f3174cf sysprof: clean up FILES
This recipe ships unversioned libraries so fiddle the intermediate variables
instead of rewriting FILES directly.

(From OE-Core rev: d6d15924a7b3fe668d4c7e88fd4c90b0d580f2ed)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
André Draszik
1ebec491aa tune-mips-24k: add QEMU_EXTRAOPTIONS for DSP and MIPS16e cores
The core emulated by default by qemu-mips(el) just crashes with
illegal instruction when encountering DSP and/or MIPS16e
instructions - we have to specify a CPU that supports the extra
instructions.

This is an issue when generating a rootfs and e.g. running some
of the package postinstall scriptlets.

The patch to qemu to add 24KEc as a CPU has been accepted
upstream, so let's use that CPU here as well as needed.

(From OE-Core rev: 8af17075f56241dd8f3ea86c609adbd73f248218)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
André Draszik
b004e3aef9 qemu: add patch to add mips 24KEc CPU definition
This patch has been accepted upstream:
http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg05778.html

(From OE-Core rev: b89bd412a69bfda262ed795e970b362ddbec6c68)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
André Draszik
0152d75a6e bash: add patch to build w/ -Wformat-security
(From OE-Core rev: 45bc8a2c4bbe252526d5eee2547f8b9e06165e5a)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Ed Bartosh
f4709b1960 uncovered: list uncovered python modules
This bash script prints list of modules uncovered by oe-selftest
or any other test that produces coverage report.

It expects coverage report on its stdin and a directory to look
for python modules as a command line parameter, e.g.
    coverage report --rcfile=build/.coveragerc | ./scripts/contrib/uncovered bitbake/
should print list of uncovered python modules from bitbake/
directory tree to stdout.

[YOCTO #9809]

(From OE-Core rev: 00d9df2b70d00b9767f32f172192f33cbf3aca0e)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Jackie Huang
81580c5c2e screen: add back the patch for parallel build
The patch 0001-fix-for-multijob-build.patch was removed by:
"d437921 screen: upgrade to 4.4.0"

But in fact the fixes is not all in the version 4.4.0, we
still get errors in parallel builds:

| ../screen-4.4.0/screen.h:48:18: fatal error: comm.h: No such file or directory

So rebase the patch and add it back.

(From OE-Core rev: 6cc3aea5ca7faf018fc50f66c7b2aa0e870addff)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:10 +01:00
Jackie Huang
b332b38ccf avahi-ui: use PACKAGECONFIG for gtk features
The commit "054ea20 avahi-ui: Build with Gtk+3"
enabled gtk3 and disabled gtk2, which causes failure on
some package depends on gtk2, like gnome-disk-utility
in meta-openembedded/meta-gnome:

| checking for GTK2... yes
| checking for AVAHI_UI... no
| configure: error: Package requirements (avahi-ui >= 0.6.25) were not met:
|
| No package 'avahi-ui' found

The gtk2 and gtk3 feature for avahi-ui is not exclusive, so change
to use PACKAGECONFIG for them so we can easily enable/disable one
of them or both of them as needed.

(From OE-Core rev: bb44ef79c1ea9fb1d2e37978bcf964e62caaf4cd)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:10 +01:00
Nathan Lynch
baaaea5145 Revert "lttng-tools: filter random filename of ptest output"
This reverts commit 29a8c45be2862be02afe2ebbc5c026a42f351990.

A few things wrong with this change:

1. It patches a patch (runtest-2.4.0.patch).
2. It introduces deviations from the desired ptest output format.
3. It discards PASS: lines from the test output; I *want* to see those.
4. The upstream status of "pending" is incorrect; I do not see this
   patch on the lttng-dev mailing list (not that it would apply anyway).

(From OE-Core rev: eeb0a912145f8f849d56c04e38616d12ca8be21e)

Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:10 +01:00
Benjamin Esquivel
2c01447ea6 oe-selftest: simplifying log filenames
avoiding characters like ':' and making a clearer separation of the
fields that compose the filename. Changing from:

oe-selftest-2016-07-20_16:05:27.log

to:

oe-selftest-20160720-160527.log

(From OE-Core rev: e7b2362d723b5dcabb440cd513380bfe8a0badb2)

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:10 +01:00
Benjamin Esquivel
e91d0d5d1c oe-selftest: export test results via xmlrunner
if available, use the xmlrunner for exporting the test results to a
dir named the same than the log where the text results are stored.
this means creating a dir with the name of the log (without the .log)
and dumping there the xml files that indicate the results of each of
the tests.

if xmlrunner is not available then it will behave the same as before,
no xml exports.

[YOCTO#9682]

(From OE-Core rev: d51f9dd34d759c77b9e7050405cbb6a88a578f73)

Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:10 +01:00
Paul Eggleton
cc3c276852 oe-selftest: recipetool: add tests for git URL mangling
Add three tests to verify that the git URL mangling is working the way
it's supposed to. This should prevent us regressing on this again in
future.

(From OE-Core rev: d8d01f462ddbb79cff23b544fcd0ce251f05f8ce)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:10 +01:00
Paul Eggleton
12fbed9e60 recipetool: create: fix greedy regex that broke support for github tarballs
The regex here needs to be anchored to the end or it'll match longer
URLs, which was exactly what I was trying to avoid. This regression was
introduced in OE-Core revision 7998dc3597657229507e5c140fceef1e485ac402.

Fixes [YOCTO #10023].

(From OE-Core rev: 9291c5d3c257d5ada7605dfe46ababda08f6d3c1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:10 +01:00
Mariano Lopez
be68ef5129 useradd.bbclass: Fix delete user/group when more than one item
Currently when a recipe adds more than one user/group, the
cleansstate task will delete only the first user/group. This
will solve this behavior and delete all users/groups.

[YOCTO #9943]

(From OE-Core rev: da191d5c139a6b400d1b8fe246912b081dd18176)

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:10 +01:00
Richard Purdie
aa2d945423 bitbake: lib/toaster: Fix missing new files from previous commits
(Bitbake rev: f77e6f21a2cc57a3fcb5970437e55cfae39849a3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 09:38:35 +01:00
Elliot Smith
5b61fa04a3 bitbake: toaster-tests: fix URL given for Chromedriver download
The link to the Chromedriver downloads page is dead, so
put in the correct URL.

(Bitbake rev: f0e6832bc33df2bb1b2f4b7f436ffbf023e24b13)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Elliot Smith
05f82e8f12 bitbake: toaster-tests: define capabilities for latest Firefox driver
For the latest Firefox versions, WebDriver requires a download of a
separate binary and an additional capability to be defined on it.

Modify our tests so that when "marionette" is set as the browser,
this capability is defined on the Firefox driver. Also add a note to the
README about the additional installation steps required.

(Bitbake rev: f6011d986f9a573a39e7b98af0aefe6cc88461ad)

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>
2016-07-29 09:53:32 +01:00
Paul Eggleton
2a849e7e9b bitbake: lib/bb/checksum: avoid exception on broken symlinks
If using OE's externalsrc with a source tree that is not tracked by git
and contains broken symlinks, you can receive "TypeError: unorderable
types: NoneType() < str()" within the file checksum code due to:

 checksums.sort(key=operator.itemgetter(1))

Don't add files with no checksum to the checksums list in order to avoid
this.

(Bitbake rev: 484fe5a3f5b840e5422cbdff0eef9aecfe944a19)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Ross Burton
ea234239f4 bitbake: lib/bb/utils: show subprocess output in stack traces
If better_exec() throws a subprocess.CalledProcessError then show the output to
the user as it likely contains useful information for solving the problem.

(Bitbake rev: 8a6424ed871c3cbacd21cae8bc801197f83d67a6)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Maxin B. John
c42b5333f0 bitbake: fetch2: fix pickle issues while switching from master to krogoth
While switching from master to krogoth build with a common download directory,
got a large number of warnings like the one listed below:

WARNING: freetype-2.6.3-r0 do_fetch: Couldn't load checksums from
donestamp /home/maxin/downloads/freetype-2.6.3.tar.bz2.done: ValueError
(msg: unsupported pickle protocol: 4)

These warnings are caused by the difference in pickle module
implementation in python3(master) and python2(krogoth). Python2 supports
3 different protocols (0, 1, 2) and pickle.HIGHEST_PROTOCOL is 2 where as
Python3 supports 5 different protocols (0, 1, 2, 3, 4) and
pickle.HIGHEST_PROTOCOL is obviously 4.

My suggestion is to use 2 since it is backward compatible with python2
(all the supported distros for krogoth provides python2 which supports
pickle protocol version 2)

(Bitbake rev: cc67800f279fb211ee3bb4ea7009fdbb82973b02)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-29 09:53:32 +01:00
Ross Burton
039f47ad19 uclibc: remove meta-yocto-bsp append
With the removal of uclibc from OE-Core, this is no longer needed.

(From meta-yocto rev: c02a10b40c5bb80cf82e85b90965206c954a77c1)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:32 +01:00
Ross Burton
1d39e4c145 dpkg: use snapshot.debian.org for SRC_URI
Using ${DEBIAN_MIRROR} for SRC_URI doesn't work very well as that will only
contain releases that are currently in Debian, so currently doesn't contain
1.18.7 as unstable has moved on to 1.18.9.

So, move all of SRC_URI to the .bb so it can use snapshot.debian.org instead,
and set UPSTREAM_CHECK_URI to ${DEBIAN_MIRROR} so upstream release checking
continues to work.

(From OE-Core rev: b32d430c3c7dccf3a8d06ab492d648893a05950f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:32 +01:00
Nathan Lynch
7cb7ca908c babeltrace: remove unnecessary SRCREV
Since this recipe doesn't use a SCM the SRCREV is unneeded (and
inaccurate).

(From OE-Core rev: 7635748f9bf2de75e94222ff286b9d02e85b2dfe)

Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:32 +01:00
Ross Burton
87678bbdc8 rt-tests: rationalise compiler flags
This recipe uses some convoluted methods to ensure the build is using the right
flags but they don't appear to be needed anymore.

No need to prepend HOST_CC_ARCH/TOOLCHAIN_OPTIONS via CFLAGS as the Makefile
picks up CC from the environment and that includes these options.

No need to append the default CFLAGS as their special options are actually in
CPPFLAGS.

(From OE-Core rev: 2230e5f7bf7e6dc747ada74477d5a72905d8d80b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:32 +01:00
Paul Eggleton
3ec9a621d0 recipetool: record unknown license files
Add a comment to the recipe listing license files that were found but
not able to be identified, so that the user can find and examine them
by hand fairly easily.

Fixes [YOCTO #9882].

(From OE-Core rev: 4b7d1bf8172533e9ac91a49ade152a05e2ee4146)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:32 +01:00
Paul Eggleton
25507bfa82 lib/oe/recipeutils: fix patch_recipe*() with empty input
If you supplied an empty file to patch_recipe() (or an empty list to
patch_recipe_lines()) then the result was IndexError because the code
checking to see if it needed to add an extra line of padding didn't
check to see if there were in fact any lines before trying to access the
last line.

Fixes [YOCTO #9972].

(From OE-Core rev: 92a73e870478ddb2a2d137e3fff28828809bec2e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:32 +01:00
Paul Eggleton
dd8540550f classes/buildhistory: ensure eSDK sstate lists sorted secondarily by name
I got fed up with seeing items dance around in sstate-package-sizes.txt
in the buildhistory git repo simply because they have the same size.
Let's sort the list first by size and then also by name to ensure items
with the same size are deterministically sorted.

(From OE-Core rev: 7340c1ea677731d21351d47d935d9de7d7e2eda5)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:32 +01:00
Paul Eggleton
82c7d0f200 classes/buildhistory: add additional variables for eSDK
Add SDK_INCLUDE_PKGDATA and SDK_INCLUDE_TOOLCHAIN to the variables that
we put into sdk-info.txt

(From OE-Core rev: 4bf5be6a1fc39f367bbb59e1787cb55e7b5835ae)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton
4048af44eb classes/populate_sdk_ext: add gdb to full extensible SDK
If SDK_EXT_TYPE is set to "full" then we really ought to be shipping
everything that is expected to be in the SDK, and that includes gdb
(it's already referred to by the environment setup script if nothing
else). This is implemented by using the SDK_INCLUDE_TOOLCHAIN
functionality I just added, since the only material thing that adds on
top of a full SDK is gdb and we should always have the rest of it in a
full SDK anyway.

Fixes [YOCTO #9850].

(From OE-Core rev: 9872dcc25c5cdfb99bda197db08476085f8c7ecc)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton
0b2ca66874 classes/populate_sdk_ext: filter sstate within the extensible SDK
Use the new oe-check-sstate to filter the sstate artifacts shipped with
the extensible SDK by effectively running bitbake within the produced
eSDK and and getting it to tell us which tasks it will restore from
sstate. This has several benefits:

1) We drop the *-initial artifacts from the minimal + toolchain eSDK.
   This still leaves us with a reasonably large SDK for this
   configuration, however it does pave the way for future reductions
   since we are actually filtering by what will be expected to be there
   on install rather than hoping that whatever cuts we make will match.

2) We verify bitbake's basic operation within the eSDK, i.e. that
   we haven't messed up the configuration

3) We verify that the sstate artifacts we expect to be present are
   present (at least in the sstate cache for the build producing the
   eSDK). Outside deletion of sstate artifacts has been a problem up to
   now, and this should at least catch that earlier i.e. during the
   build rather than when someone tries to install the eSDK.

This does add a couple of minutes to the do_populate_sdk_ext time, but
it seems like the most appropriate way to handle this.

Should mostly address [YOCTO #9083] and [YOCTO #9626].

(From OE-Core rev: 4b7b48fcb9b39fccf8222650c2608325df2a4507)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton
2ac1fdf537 scripts: add oe-check-sstate script
Add a script to check which sstate artifacts would be installed by
building a given target - by default this is done with a separate
TMPDIR to ensure we get the "from scratch" result. The script produces a
list of tasks that will be restored from the sstate cache. This can also
be combined with BB_SETSCENE_ENFORCE* to check if sstate artifacts are
available.

The implementation is a little crude - we're running bitbake -n and
looking at the output. In future when we have the ability to execute
tasks from tinfoil-based scripts we can look at rewriting that part of
it to use that instead.

(From OE-Core rev: 4d059e02099e6244765027f2771192434764c606)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton
4253e2e0f3 classes/populate_sdk_ext: allow including toolchain in eSDK on install
If we're to completely replace the standard SDK with the extensible SDK,
we need to be able to provide the standard toolchain on install without
doing anything other than installing it, so that you can install the SDK
and then point your IDE at it. This is particularly applicable to the
minimal SDK which normally installs nothing by default.

NOTE: enabling this option currently adds ~280MB to the size of the
minimal eSDK installer. If we need to reduce this further we would have
to look at adjusting the dependencies and/or the sstate_depvalid()
function in sstate.bbclass which eliminates dependencies, or look at
reducing the size of the artifacts themselves.

Implements [YOCTO #9751].

(From OE-Core rev: ed0d8ed72370df694f720cc13897493478dc1de9)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton
f84b01b289 meta-extsdk-toolchain: add meta-recipe to install toolchain into eSDK
Add a meta-recipe to bring the toolchain into the extensible SDK. This
was modelled on meta-ide-support but some adjustments were needed to the
dependency validation function in sstate.bbclass to ensure that all of
the toolchain gets installed into the sysroot. With this, after
installing a minimal eSDK you only need to run the following after
sourcing the environment setup script to get the toolchain:

  devtool sdk-install meta-extsdk-toolchain

Addresses [YOCTO #9257].

(From OE-Core rev: 8110806b1b5534ae830a4fdd1a5293c86a712d0b)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Paul Eggleton
cb5d308c48 classes/populate_sdk_ext: set default for SDK_INCLUDE_PKGDATA
We don't absolutely need this - it doesn't change the default
behaviour, but it seems to me we have a convention to set default values
so we should add one here.

(From OE-Core rev: 4c734df1df3c19b0dabb9da5b4dc86b966a0d71c)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Ross Burton
1b4dc787b8 oeqa/selftest/signing: check that we have GPG in setup
(From OE-Core rev: 6eb6fde2567a2692afccb7ee0546b2c992c168aa)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Ross Burton
5218c24c8b oeqa/selftest/signing: use a temporary directory for GPG home
Instead of using a directory in the layer as the GPG home and carefully deleting
the right files from it, use tempfile to create a temporary directory which will
be cleaned up for us.

Also change the public/secret key variables to be absolute paths as they're
always used as absolute paths.

(From OE-Core rev: d4a5b5d11c6d7d5aba5f2eb88db091c1b98ef87c)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:31 +01:00
Roy Li
ab075b6fb8 kdump: don't set default values for KDUMP_CMDLINE and KDUMP_KIMAGE
Do not set default values of KDUMP_CMDLINE and KDUMP_KIMAGE, and leave
them set by configure file since they are different for different
architectures. Take KDUMP_KIMAGE kdump kernel image for example:

    x86 is bzImage
    mips64 is vmlinux
    ppc is uImage
    arm is zImage

(From OE-Core rev: 05dcb054fcd0c80bb09612c3e15b6b1f0487aae8)

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
Maxin B. John
9b8b730d24 harfbuzz: upgrade to 1.3.0
1.2.7 -> 1.3.0

(From OE-Core rev: acff48731ea19c11768fed076d696fd1cb0bbbf0)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
Maxin B. John
8b0db50da5 bluez5: upgrade to 5.41
5.40 -> 5.41

(From OE-Core rev: 633e73fb780da76e5025483310c3ca7eb5f78a26)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
Andre McCurdy
b261791d69 dhcp: remove dhclient-script bash dependency
Take the dash compatible IPv6 link-local address test from the Debian
version of dhclient-script.

Note that although "echo -e" in the OE version of dhclient-script is
technically bash specific too, it is supported by Busybox echo when
Busybox is configured with CONFIG_FEATURE_FANCY_ECHO enabled (which
is the default in the OE Busybox defconfig) therefore leave as-is.

(From OE-Core rev: acd7b33d136fac52e1da7ce1bb3edd2a938b1b6f)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
Shan Hai
21916fe5b6 net-tools: lib/inet6.c:INET6_rresolve() - various fixes
Integrate the commit from a70c568b90
to fix a bug which causes the 'netstat -a' to print "[UNKNOWN]" in case of
DNS problem instead of IPv6 address.

(From OE-Core rev: e99a7220bbc2d605200d5005ba40bf45f6f8dcf5)

Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
Khem Raj
012262ad6a gcc: Don't use vectorized builtins when Neon is not there
Fixes [YOCTO #9991]

(From OE-Core rev: 0d69b3bf6cdeee866642529b6269391146333a43)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
Maxin B. John
6660e95cbf sysprof: fix floating dependency on polkit
Fix the floating dependency on polkit by providing a PACKAGECONFIG
option. Then, package the newly created files appropriately.

[YOCTO #9987]

(From OE-Core rev: a1ecd168b092a0cc7322431913fd1f42cfa9a37e)

Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
André Draszik
71d0c871c9 kernel.bbclass: explicitly set workdir in do_bundle_initramfs
bitbake rev 67a7b8b02 "build: don't use $B as the default cwd for
functions" (included in current bitbake master) breaks the assumption
that do_bundle_initramfs runs inside the build directory.

This causes kernel_do_compile() as called from within
do_bundle_initramfs() to fail, as the former is not being executed
from the correct directory anymore. (Note that kernel_do_compile()
as called from bitbake directly doesn't suffer from that problem,
as it inherits the workdir from base_do_compile() in that case.)

Set workdir explicitly.

(From OE-Core rev: 4455da22a151c2ac006af63cbd39779b21b12580)

Signed-off-by: André Draszik <git@andred.net>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
Kai Kang
4858c6b728 kernel-uimage.bbclass: indeed update var KERNEL_IMAGETYPE_FOR_MAKE
The replace() method of the python string class doesn't replace
in-place, then the var KERNEL_IMAGETYPE_FOR_MAKE doesn't be updated as
design.

(From OE-Core rev: 392fc3cd276d5029314c7158245bc65dd82279cd)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
André Draszik
7178f0732d musl: don't compile in mips16e mode
musl contains hand-written assembly which is not compatible with
the MIPS16e mode.

(From OE-Core rev: dbbd58cb64b12cb4dc816425eee59c56cd46301f)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:30 +01:00
Clemens Lang
1131507d46 lib/oe/path: Fix tar invocation with --no-recursion
tar's --no-recursion flag only applies to files mentioned after the
flag, which made it a no-op in this invocation of tar, because it was at
the end of the command line.

This is simple to verify with GNU tar 1.29:

| $ mkdir foo
| $ mkdir foo/dir
| $ touch foo/dir/file
| $ tar -cf - foo --no-recursion | tar t
| foo/
| foo/dir/
| foo/dir/file
| $ tar -cf - --no-recursion foo | tar t
| foo/

Modify the code so that it actually does what the comment says by moving
the flag in front of the --files-from argument.

(From OE-Core rev: d45f5e71fef5ffbd4408f69c5c179dc71a3eb452)

Signed-off-by: Clemens Lang <clemens.lang@bmw-carit.de>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Khem Raj
57bb38d263 gcc: Fix libgcc unresolved symbols with PIE on musl
Fixes

[YOCTO #9772]

(From OE-Core rev: f96da00e78999899ea7037ebc9547a87023e309a)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Khem Raj
13ee352a1f webkitgtk: Do not use gold with clang
clang cross compiler fails to detect gold linker from
cross-binutils, instead it defaults to ld.gold from build
host, lets disable using gold when clang is active to avoid
this issue

(From OE-Core rev: 2a535deb4e080f464db1ffc40dfc53235fa13874)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Ross Burton
7d04a4dbfd insane: only check ${S} exists if we had sources to fetch
Only check that ${S} actually exists if there was something in ${SRC_URI} to
fetch, the argument being that if SRC_URI is empty the the recipe won't be using
${S} at all.

In general recipes that have no sources can remove the unpack task, but
expecting all recipes to do this relatively advanced operation isn't realistic.

(From OE-Core rev: 8cba511ab6ea557fab9f7838dfe1fc8284bbdd68)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Ross Burton
2eec44ee23 lib/oe/gpg_sign: fix output in error paths
oe.utils.getstatusoutput() is a wrapper for subprocess.getstatusoutput() which
uses Universal Newlines, so the output is a str() not bytes().

(From OE-Core rev: ce24d4c3632b71939ad198268a900ee823a89b27)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
mingli.yu@windriver.com
f02f0edeaa python-smartpm: add support to check signatures
RPMv5 has removed support for _RPMVSF_NOSIGNATURES,
the flag can be replaced with a flags set:
"RPMVSF_NODSAHEADER|RPMVSF_NORSAHEADER|RPMVSF_NODSA
RPMVSF_NORSA"

(From OE-Core rev: 5c0c1b8a64643ad7130b17b5dfce9cecffa6d962)

Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
mingli.yu@windriver.com
2f6bbc7006 openssh: conditional compile DES code.
After openssl disabled DES, openssh fails to build
for some DES codes are not wrapped in conditional
compile statement "#ifndef OPENSSL_NO_DES" and "#endif".

(From OE-Core rev: cd9c62461e837967dd29a532d32990c23350acf8)

Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Robert Yang
2c2f22a533 packagefeed-stability.bbclass: copy all packages of a recipe
A recipes can generate several rpms such as a.rpm, a-dev.rpm, a-dbg.rpm,
when update one of them in the repo, we'd better update all of them,
otherwise, there might be a-dev.r0.1.rpm and a-dbg.r0.3.rpm in the repo,
which looks strange.

(From OE-Core rev: 2a7f203dbe4fda5dba9137503e93669392719aba)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Robert Yang
600f0b3e04 packagefeed-stability.bbclass: minor fixes
* fix for python3
  iteritems() -> items()

* Return immediately for native and cross.
* Remove the usage of __BBDELTASKS, there is no such var in bitbake.

(From OE-Core rev: ccfc13adedd97f57024420639053080e047529dc)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Paul Eggleton
b36753b1c9 packagefeed-stability: add class to help reduce package feed churn
When a dependency causes a recipe to effectively be rebuilt, its output
may in fact not change; but new packages (with an increased PR value, if
using the PR server) will be generated nonetheless. There's no practical
way for us to predict whether or not this is going to be the case based
solely on the inputs, but we can compare the package output and see if
that is materially different and based upon that decide to replace the
old package with the new one.

This class effectively intercepts packages as they are written out by
do_package_write_*, causing them to be written into a different
directory where we can compare them to whatever older packages might
be in the "real" package feed directory, and avoid copying the new
package to the feed if it has not materially changed. We use
build-compare to do the package comparison.

(From OE-Core rev: cc8b1a93912f830e605e6249c446b3764e550863)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:29 +01:00
Robert Yang
cbf7902030 package_deb.bbclass/package_ipk.bbclass: sort RPROVIDES
The dict.fromkeys() creates a dict without order, there might be a
problem when build the same recipe again, for example:

- First build of make:
  Provides: es-translation, make-locale
- Second build of acl:
  Provides: make-locale, es-translation

They are exactly the same Provides, but tools like "diff" doesn't think
so. Sort RPROVIDES will fix the problem.

(From OE-Core rev: 3506172d7d9f8d92362b6ebb75582b7c3e662dae)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Robert Yang
9621959a3a build-compare: improve deb and ipk checking
* The deb and ipk's depends version string is like:
  Depends: libc6 (>= 2.24)
  Update trim_release_old and trim_release_new to match the bracket in
  the end ")".

* The deb's data tarball now is .tar.xz, and ipk's is .tar.gz.

* Update adjust_controlfile() to make ituse trim_release_old and
  trim_release_new.

(From OE-Core rev: c92152e521a9f96a741eccd4a4bf5ddfbd59a7ae)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Robert Yang
ad6aae3106 build-compare: fix checking for named pipe and others
* Fixed checking for named pipe
* Return at once when archives are the same
* Fix for type "directory"

(From OE-Core rev: e3245747342860da44fcbb49ac68b8b33e5b43a3)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Robert Yang
fef5ae147e build-compare: make pkg-diff.sh 75% faster
The rpm tool is a heavy process, pkg-diff.sh ran 16 (or 17 for kernel)
"rpm -qp" times when the pkgs are identical, now we only run
"rpm -qp --qf <all we need>" twice (one is for old pkg, and one is for
new), save the results to spec_old and spec_new, then use sed command to
get what we need later, this can make it 75% faster when the pkgs are
identical. Here is the rough data on my host Ubuntu 14.04.4, 32 cores
CPU and 128G mem:
* When the pkgs are identical:
  - Before the patch: 1s
  - After the patch: 0.26s
  I compare the whole spec firstly, and return 0 if they are the same,
  or go on checking one by one if not, without this, it would be 0.46s,
  the gain is great when there are lot of packages, usually, we have
  more than 10,000 rpms to compare.

* When the pkgs are different:
  That depends on where is the different, if the different is at the
  comparing rpmtags stage:
  - Before the patch: 0.26s
  - After the patch: 0.29s
  Increased 0.03s, but if the different is happend later than comparing
  rpmtags, it will save time.

(From OE-Core rev: 71eee4adbcda1d9e75cbce58045d03ea12432431)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Robert Yang
495e2f80a9 build-compare: remove space at head
The command like:
rpm -qp --nodigest --nosignature --qf '<foo> [%{REQUIRENAME}\n]\n'
                                            ^^space

The space will be printed, and will impact the check result, so remove it.

(From OE-Core rev: 79c574979f64f2dbe8ca05774446de21a53b3a87)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Robert Yang
51b08835b6 rpm: make --nosignature work
OE-core uses rpm's --nosignature, but it never worked:
self._invoke_smart('config --set rpm-check-signatures=false')

Now fix it with:
* Define SUPPORT_NOSIGNATURES to 1 in system.h
* !QVA_ISSET(qva->qva_flags, SIGNATURE) -> QVA_ISSET(qva->qva_flags, SIGNATURE),
  otherwise, when use --nosignature would read database and verify
  signature, this is not expected.

This can fix some race issues, for example, when more than one process
are querying rpm file with "rpm -qp --nosignature", they may hang up
because of race issues (the processes are trying to get RW/RD lock on
the database, but they shouldn't read the database at all since -qp and
--nosignature are used).

(From OE-Core rev: 038c09d6ab9581030efdc16aa1b96972970eeaab)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Matt Madison
2ab49268fd package_deb.bbclass: fix Python 3 error
Don't modify an OrderedDict while walking its keys.

(From OE-Core rev: eb7f08c4c01313afc8350200eeb63daefde8a6f6)

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Jussi Kukkonen
0e63414bc3 piglit: Add build fix patch
Fixes [YOCTO #9851] (fingers crossed).

(From OE-Core rev: 913149f269679bda87badb94e1de66646fdc5362)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Kai Kang
ad625f7f9b avahi: fix resource temporarily unavailable issue
It sometimes fails to run avahi with error: "Could not receive return value
from daemon process". It has same root cause with
https://github.com/lxc/lxc/issues/25.

Backport patch to fix this issue.

(From OE-Core rev: a901956968127b2eb5911d7b91f44fca46e30b25)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Tanu Kaskinen
05dca6eae3 pulseaudio: fix floating dependency on webrtc-audio-processing
The webrtc-audio-processing library isn't yet packaged for
OpenEmbedded, but let's add a packageconfig entry for it anyway to
avoid problems in the future.

(From OE-Core rev: afcdc3d9d83cc72eb22c00160770282cd72dbca7)

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:28 +01:00
Tanu Kaskinen
7c9acf0ea4 pulseaudio: 8.0 -> 9.0
Release notes:
https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/9.0/

Rebased 0001-client-conf-Add-allow-autospawn-for-root.patch.

Removed 0001-Revert-module-switch-on-port-available-Route-to-pref.patch,
because the issues that were caused by the reverted commit have been
fixed.

The patch set that fixes the initial selection of HDMI profiles
(YOCTO#8448) is replaced with updated patches cherry-picked from
upstream.

(From OE-Core rev: 319595e8264af32c54ba6324e220eb4ec43b7565)

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Tanu Kaskinen
328e249399 libsndfile1: 1.0.26 -> 1.0.27
(From OE-Core rev: e5128874a93519ff5ef8a66dbccd4d89feaba32b)

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Paul Eggleton
24f871c801 classes/populate_sdk_ext: show progress when preparing build system
During the extensible SDK installation process the final step is to
prepare the internal copy of the build system. This can take some time,
especially if you have SDK_EXT_TYPE set to "minimal" (downloading
sstate artifacts) and SDK_INCLUDE_PKGDATA set to "1" (restoring
pkgdata for world). To make this a bit less painful, use BitBake's new
quiet mode to display status during this operation so you have some idea
of how it's progressing; instead of redirecting the output to
preparing_build_system.log we grab the last console log and append it
instead.

One result of this change is that you get the errors printed on the
console during normal output rather than this going to the
preparing_build_system.log file first. In OE-Core revision
227d2cbf9e0b8c35fa6644e3d72e0699db9607fa, we changed to always print the
contents of preparing_build_system.log on failure, but now at least the
error contents of that log is duplicated. Besides, I intentionally
didn't print out the contents of that log during normal usage because
it's quite verbose - the bug that we were attempting to fix was about
not getting this information when seeing failures in the automated
tests, thus I've moved printing the log to the test handling code
instead.

Part of the implementation for [YOCTO #9613].

(From OE-Core rev: 0f7cb880c934b7871f3b8432f4f02603300f6129)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Ross Burton
1052fef94e layer.conf: bump version for uclibc removal and LSB update
As of oe-core layer version 9, uclibc has been removed and LSB approximates
version 5 (which means that Qt 3 isn't required for LSB conformance).

(From OE-Core rev: e2900a30cc36ced67d157814b0f6afbd8f1ff8ed)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Ross Burton
bb9d9dacca uclibc: remove
uclibc is showing its age now and upstarts like musl are approximately the same
size but with far more features and active maintainers.  Remove uclibc from
oe-core and use endorse musl as the lighter alternative to full-fat glibc.

(From OE-Core rev: ff1599149942af1c36280abd4f1ed3878aaa62eb)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Dengke Du
560077821a LSB: 4.1.0 -> 5.0
According to the LSB 5.0 Release Notes, FHS Released, Qt3 removed
and evoloved its module strategy which you can access from the
site:
	https://wiki.linuxfoundation.org/en/ReleaseNotes50

So we make two changes to comply with the LSB 5.0:
1. Remove the lsb-test-qt3-azov-*.rpm test package and delete the
   test session.
2. Update the test packages.

(From OE-Core rev: 89771f2dfc58b83a457147f8498214d7a2bfae43)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Jose Perez Carranza
e6e05a30b1 systemd_boot: Enable module to test systemd bootloader
Module systemd_boot created wtih a class "Systemdboot"
 and a test case "test_efi_systemdboot_images_can_be_built"
 to test new systemd bootloader.

 [YOCTO #9706]

(From OE-Core rev: 3f859816aef3c3dba35cfbea15f0c56483205544)

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Carlos Alberto Lopez Perez
efd7d6b6fc webkitgtk: Switch the ARMv7 build to Thumb2 and enable back the JSC JIT.
* The JSC JIT is broken on ARMv7 without Thumb2.

[YOCTO #9474]

(From OE-Core rev: bb7bc6061b70648635d969e66c6ed333ca5f427e)

Signed-off-by: Carlos Alberto Lopez Perez <clopez@igalia.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Kai Kang
b6aa976756 quota: make compile pass when disable rpc
When 'rpc' is not in PACKAGECONFIG, option '--disable-rpc' is passed to
configure and then compile fails. Backport patches to make quota build
successfully.

Update fcntl.patch that part of the patches are added by
0002-Allow-building-on-systems-that-do-not-have-rpc-heade.patch.

(From OE-Core rev: aff36f4c4d241707744fe13b6310fb894610a0f3)

Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:27 +01:00
Tom Hochstein
b7a2688ac8 weston-init: De-couple framebuffer console from Weston for systemd startup
The framebuffer console was using the same I/O as Weston. We fix this
by having openvt switch to the new VT when starting weston-launch, same
as is already done for the sysvinit case.

(From OE-Core rev: fba47b9d881af40eb2462aefd19040dc08314365)

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Tom Hochstein
df9f8a89fb weston-init: Fix weston-start to handle 0 or 1 args
The parser incorrectly treated anything less than 2 args as an error.

(From OE-Core rev: 24d155d2d9be402a04fbd68b6a4ccf990deb9ce6)

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Tom Hochstein
9f7c1a5a99 weston-init: Fix weston-start to allow weston args without openvt args
The parser didn't properly handle commands of the form
weston-start -- <weston-options>.

(From OE-Core rev: 84dc6a5b277b977488a5dda39feeff3482dfafe3)

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Robert Yang
c406e9acd7 ccache: 3.2.4 -> 3.2.5
Add Revert-Create-man-page-in-the-make-install-from-git-.patch to
disable asciidoc since we don't have it.

(From OE-Core rev: 40627f5c334544178b056078da5e1d645ebd2a38)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Robert Yang
36f6219c49 gettext-minimal-native: 0.19.4 -> 0.19.8.1
How to upgrade gettext-minimal-native:
  - Build gettext-native
  - Copy gettext-runtime/po/Makefile.in.in, build-aux/config.rpath and
    gettext-runtime/po/remove-potcdate.sin from gettext-native.
  - Update COPYING when needed (usually update the year), do not copy
    the whole COPYING file from gettext-native.
  - Go to gettext-native's ${S}/gettext-runtime/m4:
    > Remove lt*.m4 and libtool.m4
    > copy lib-ld.m4 lib-link.m4 lib-prefix.m4 from ${S}/gettext-runtime/gnulib-m4/
    > tar czvf /path/to/aclocal.tgz *.m4

(From OE-Core rev: 2b82c24a6b0148d1cc548605eab9be85f356ab6d)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Robert Yang
cff21235c2 gettext: 0.19.6 -> 0.19.8.1
(From OE-Core rev: 450f4597d491789b0680940218e0e0bee7104ada)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Robert Yang
91a6f3a375 slang: 2.2.4 -> 2.3.0
* Removed:
  change-char-type-to-signed-char-in-macros.patch
  sprintf-bug-concerning-8-bit-characters.patch
  They are already in the source.

* Updated:
  fix-check-pcre.patch
  fix-check-pcre.patch
  slang-fix-the-iconv-existence-checking.patch

* Use SECURITY_NO_PIE_CFLAGS for SECURITY_CFLAGS, it can't be built with
  "-pie -fpie":
  tmp/sysroots/qemux86-64/usr/lib64/../lib64/Scrt1.o: In function `_start':
  /usr/src/debug/glibc/2.24-r0/git/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
  /tmp/ccMFTA8A.o: In function `smg_char_at':
  /usr/src/debug/slang/2.3.0-r0/slang-2.3.0/modules/slsmg-module.c:134: undefined reference to `SLsmg_char_at'
  /tmp/ccMFTA8A.o: In function `smg_resume_smg':

(From OE-Core rev: b2d6e069b9ecc5a13754393200a6fa48cdaaf4c6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Robert Yang
2186bbca70 gnu-efi: 3.0.3 -> 3.0.4
* Remove gnu-efi-Make-setjmp.S-portable-to-ARM.patch since it is already
  in the source.

* Updated LIC_FILES_CHKSUM
  - The following files are gone:
    lib/arm/div64.S
    lib/arm/lib1funcs.S
  - Updated md5sum for other files, they add the following words, which are
    still GPLv2+:
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:
    1. Redistributions of source code must retain the above copyright
       notice and this list of conditions, without modification.
    2. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    Alternatively, this software may be distributed under the terms of the
    GNU General Public License as published by the Free Software Foundation;
    either version 2 of the License, or (at your option) any later version.

* Remove -mfpmath=sse from TUNE_CCARGS since gnu-efi doesn't support sse to fix the
  problem:
  rtdata.c:1:0: error: SSE instruction set disabled, using 387 arithmetics [-Werror]

* gnu-efi's Makefile treats prefix as toolchain prefix, so don't export it,
  otherwise there would be errors:
  /bin/sh: /usrgcc: No such file or directory

* Add aarch64-initplat.c-fix-const-qualifier.patch to fix build on aarch64:
  initplat.c:44:35: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]

(From OE-Core rev: e011f70741d9c60ab68a0fa2458a5051030efd64)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Robert Yang
6d9958ee9d guile: 2.0.11 -> 2.0.12
* Remove these patches which already in the source:
  - libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch
  - remove_strcase_l_funcs.patch
  - 0001-libguile-Check-for-strtol_l-during-configure.patch

* Update 0002-Recognize-nios2-as-compilation-target.patch

(From OE-Core rev: 42fd94e8168e618b7a45b1261ee5c06bb38548e4)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Robert Yang
cf0395203a git: 2.8.4 -> 2.9.2
(From OE-Core rev: 084c4c38dd168fe997d45d94bdca0db2608651a1)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Richard Purdie
cea867b532 linux-yocto-dev: Ensure we don't reparse the recipe when its not being used (take 2)
The use of the ${AUTOREV} variable means bitbake would always re-parse the
recipe. This isn't desirable when its disabled so undo the always parsing
flag in this case.

(From OE-Core rev: f1fce69766576ab62bfc5919af2af04028180950)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:26 +01:00
Richard Purdie
e1fcb032e2 Revert "linux-yocto-dev: Handle performance regression"
This recipe no longer functions after this change, revert it.

This reverts commit 3e0137113e.

(From OE-Core rev: 5e8cf6e568ab90365894478a272b5c28dc941031)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:25 +01:00
Ross Burton
31cef0d518 lib/oeqa/decorators: handle broken links when creating new symlink
When checking if a link exists before creating it, use os.path.lexists() as
otherwise os.path.exists() on a broken link will return False.

(From OE-Core rev: ec24b6de2b8686e1f779fef3a963e66f70eeba74)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:25 +01:00
Richard Purdie
ebc80fa30a siteinfo: Add mechanism to extend siteinfo information from BSP layer
In order to add a new architecture or sub-architecture to OE, you currently
need to tweak the table in siteinfo.bbclass. This adds a mechanism so this
can be done from a BSP layer. It needs a function definition which needs
a class file but can then be done with something like:

def rp_testfunc2(archinfo, osinfo, targetinfo, d):
    archinfo['testarch'] = "little-endian bit-32"
    osinfo['testos'] = "common-linux"
    targetinfo['mymach-linux'] = "mymach-linux-common"

    return archinfo, osinfo, targetinfo

SITEINFO_EXTRA_DATAFUNCS = "rp_testfunc2"

[YOCTO #8554]

(From OE-Core rev: 2718bb9f2eabc15e3ef7cb5d67f4331de4f751d6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:25 +01:00
Richard Purdie
e693f2e641 insane: Add mechanism to extend QA machine information from BSP layer
In order to add a new architecture or sub-architecture to OE, you currently
need to tweak the table in insane.bbclass. This adds a mechanism so this
can be done from a BSP layer. It needs a function definition which needs
a class file but can then be done with something like:

def my_testfunc(machdata, d):
    machdata["testmachine"] = {
                        "test64":       ( 8,     0,    0,          False,         32),
                        "testel":     ( 8,     0,    0,          True,          32),
                      }
    return machdata

PACKAGEQA_EXTRA_MACHDEFFUNCS = "my_testfunc"

[YOCTO #8554]

(From OE-Core rev: c57550c9cca598315ba4408e44b138cecc22b8a0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:56:25 +01:00
Ross Burton
1393b23f51 bitbake: lib/bb/build: handle incomplete message fragments in log FIFO
It's possible that the logging FIFO doesn't do a complete read (or the sender a
complete write) with the result that an incomplete message is read in bitbake.
This used to result in silently truncated lines but since 42d727 now also
results in a warning as the start of the rest of the message isn't a valid
logging command.

Solve this by storing incoming bytes in a bytearray() across reads, and parsing
complete messages from that.

[ YOCTO #9999 ]

(Bitbake rev: 508112793ee7ace613f07695222997309a2ca58f)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:37 +01:00
Elliot Smith
9411e33b88 bitbake: toaster-tests: add tasks and recipes sub-page tests
Add tests for the tasks and recipes sub-pages of the build
dashboard.

[YOCTO #9833]

(Bitbake rev: cecee440a76950f2824ea34b88e84185be493337)

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>
2016-07-26 08:10:37 +01:00
Elliot Smith
4357d7a296 bitbake: toaster: set non-hideable columns for built recipes table
None of the columns in the built recipes table are marked
as not hideable, so it is possible to remove all the columns
and make the table disappear.

Set the recipe name and version columns as not hideable.

Also rename the "Name" column to "Recipe", for consistency with
the design and with other recipe tables.

[YOCTO #9833]

(Bitbake rev: 3abd0ac300462e6d1335018cf2d0420de7cc8b76)

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>
2016-07-26 08:10:36 +01:00
Elliot Smith
bd2cce00de bitbake: toaster: set non-hideable columns for build tasks table
The task, recipe and order columns in the build tasks table
should not be hideable. If they are, it's possible for the
table to have all of its columns hidden so that it no longer
displays.

Set the hideable property to prevent these columns from being
hidden.

[YOCTO #9833]

(Bitbake rev: dc1781e3783724823fd6b0c2d65f6b2771e8d0be)

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>
2016-07-26 08:10:36 +01:00
Elliot Smith
83ccef335c bitbake: toaster: fix download URL for task logs
The task display template formatting had split the Django
url template tag across two lines and broken it. This resulted
in a gibberish URL for task logs.

Fix by placing the tag and its arguments on a single line.

[YOCTO #9837]

(Bitbake rev: d6e88b7b410b6b99b47b031111a1126da9fd31b3)

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>
2016-07-26 08:10:36 +01:00
Mario Domenech Goulart
24905d3c2d bitbake: fetcher2/__init__: Print command in case of ExecutionError in runfetchcmd
(Bitbake rev: df7f4897c463a48c45514e2bcbd44cc7f86c4bb0)

Signed-off-by: Mario Domenech Goulart <mario.goulart@bmw-carit.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:36 +01:00
Michael Wood
729d9fcb54 bitbake: toaster: loadconf Partially add back some of the layerSource parsing
Partially add back a revised version of the layersource handling so that
we can continue to support the old toasterconf.json and it's setup of
the local project.

(Bitbake rev: cc1a1bc2ea6ae058278d4ecf483f5ea00502c6cb)

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>
2016-07-26 08:10:36 +01:00
Michael Wood
04d1ad5fe7 bitbake: toaster: admin Add Layer_Version to the admin-able models
If the migration didn't get the release conversion right for say, a
local or imported layer it would be handy to be able to edit this
in the django admin page.

Also useful for developers to be able to tweak layers on the fly.

(Bitbake rev: 0b23b6919ef1162a0c7fb5b5a961a24653c51eb2)

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>
2016-07-26 08:10:36 +01:00
Michael Wood
97278fb51c bitbake: toaster: orm Remove the layerindex specific up_branch fields
We don't need to keep track of layerindex data in our database. And
using branch==release is very confusing in the schema. Instead use the
existing Release definition to keep track of which release a
layer_version is for.

Remove the Branch model and all references to it.

Create a migration path to convert from up_branches to their
corresponding releases.

(Bitbake rev: f8f4cffe6fd371f3a7e63690c68f3fcb5dc1f297)

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>
2016-07-26 08:10:36 +01:00
Michael Wood
8b3146007f bitbake: toaster: lsupdates Add progress information and clean up logging
Adds basic progress % information and provides better description of
what is happening.

(Bitbake rev: 6393dbf97d450d2521c0bc9429da0987bb7720ec)

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>
2016-07-26 08:10:36 +01:00
Michael Wood
bb260e94a6 bitbake: toaster: tests: Remove references to LayerSource model
Remove and replace layersource model references in the tests and test
data. Remove the orm/test as this only tested LayerSource interactions
which have now been removed.

(Bitbake rev: 61a47cbc92c856690cb0e8da7102b2e669eaee0a)

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>
2016-07-26 08:10:36 +01:00
Michael Wood
ef627d0ab8 bitbake: toaster: Replace references to LayerSource models
Replace references to the now deprecated layersource models across
Toaster with the new enums for layer source types.

(Bitbake rev: 48c09c62eb979d840132e58144f0d81ffee675b1)

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>
2016-07-26 08:10:36 +01:00
Michael Wood
ffc78d329d bitbake: toaster: lsupdates Add layerindex fetcher
Move and refactor the layerindex layer source update mechanism so that
we don't have to track the layerindex objects in the toaster database.
Move this out of the orm and into the management command.

Paves the way for future improvement to allow you to specify a layer
index server as an argument to the command.

(Bitbake rev: f83527edc6d52a34cd73a9c3650ee484407e2e0c)

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>
2016-07-26 08:10:36 +01:00
Michael Wood
853450befc bitbake: toaster: models Remove LayerSource models and replace with enum
We had a lot of complexity around different layer sources to allow for
multiple sources and different priorities for these source. This was
implemented using rigged abstract classes which represented the
different layer sources when in fact just an enum/flag on the
layer_version object is sufficient for our needs.

Remove the LayerSourcePriority object as this is not needed. We no longer
have a problem of multiple layers coming from multiple sources so this
is not needed. Two migrations are added to first remove the child models
which represented layersources. Then a second migration is needed to
remove the LayerSource model it's self as Django can't understand the
non-standard base class dependency. Triggering this issue:
https://docs.djangoproject.com/en/1.8/topics/migrations/#dependencies

Clean up a number of flake8 warnings in classes which were modified.

[YOCTO #9853]

(Bitbake rev: 26624740418de95adb1f4a970a30a5f1149ebb79)

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>
2016-07-26 08:10:35 +01:00
Michael Wood
20f939f242 bitbake: toaster: bldcollector admin Remove LayerSourceAdmin
Remove the LayerSource admin from django admin interface. LayerSources
are not going to be manageable from the admin interface.

(Bitbake rev: 1c20ffcf88c5b73f6cf5e9b69b81e6bc8cd2493d)

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>
2016-07-26 08:10:35 +01:00
Michael Wood
1477886deb bitbake: toaster: loadconf remove Loading LayerSources
We don't need to configure layer sources in the initial configuration as
this information is provided by the models.

(Bitbake rev: fd56c152699bc4c2d22b87728d0fefbff5209135)

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>
2016-07-26 08:10:35 +01:00
Paul Eggleton
c27ae255db bitbake: lib/bb/progress: avoid possibility of start event being reported twice
In MultiStageProgressReporter, set a guard when we start the progress
so that it can't happen more than once. This fixes "Initialising
tasks.." being shown twice in succession when running bitbake in
non-interactive terminal mode.

(Bitbake rev: 923e68e069127ee7f6e11b91eb1cfa09d502a110)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Paul Eggleton
5f4559b2eb bitbake: knotty: don't display ETA for tasks with progress
It turns out that progress information we can extract from a task is
rarely apportioned closely enough to the time taken for the ETA to be
accurate, so showing it is going to be misleading most of the time for
anything but the most basic of examples. Let's just remove it and avoid
misleading (or worse, annoying) the user.

Fixes [YOCTO #9986].

(Bitbake rev: 235db4870b11db97250979e647b54cdb5ce4fbb6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Paul Eggleton
23a551bea1 bitbake: knotty: fix some minor bugs in BBProgress
If you specify custom widgets then we don't want to assume where the
"extra" position is - you should have to specify it, and if it isn't
specified it shouldn't just wipe out the last widget or you can start to
see odd behaviour if you're modifying the code.

(Bitbake rev: 19e33c10feb1637589ceb05b5e8d58b1e012ccb8)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Enrico Scholz
0c3ce68410 bitbake: fetch: copy files with -H
When using a PREMIRROR with plain (non-unpack) files, a SRC_URI like

SRC_URI = "file://devmem2.c"

will cause devmem2.c to be a symlink in the WORKDIR pointing to the
local PREMIRROR.

Trying to apply a patch on this file will either modify the file on
the PREMIRROR or will fail due to sanity checks:

ERROR: devmem2-1.0-r7 do_patch: Command Error: 'quilt --quiltrc /cache/build-ubuntu/sysroots/x86_64-oe-linux/etc/quiltrc push' exited with 1  Output:
Applying patch devmem2-fixups-2.patch
File devmem2.c is not a regular file -- refusing to patch

(Bitbake rev: cfd481fe9799e7a4c6bfac32e56cc91cfcd81088)

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie
7f6b6b2ab9 bitbake: cache: Don't interleave pickle cache file writing
For some reason the data written in this way is coming back out the
files out of order. I've not been able to simplify the test case to a
point where this was standalone reproducible. Simplify the code and
write out the cache files sequentially since this seems to avoid the
errors and makes the code more readable.

(Bitbake rev: 14ec47f5f0566dbd280fae8a03160c8500ad3929)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie
5d41200113 bitbake: cache: Add better cache loading sanity checks
We've seen cache corruption where the pairs come out in a different
order to the way we saved them for unknown reasons. Add better sanity
checking to give a more user friendly error rather than a crash/traceback.

Also allows the system to reparse and recover.

(Bitbake rev: 4be4a15491530bd6dc018033ad3d4b2562ab6e23)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie
40d45cf7a6 bitbake: cache: Drop/simplify pointless type checking
Since we no longer have random data like version fields in these structures
and we can assume any extra cache data subclasses our class, simplify the
code.

This is mostly reindenting after removal of the pointless type checks.

(Bitbake rev: 5eb36278ac9975de1945f6da8161187320d90ba7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie
c9e65c5d29 bitbake: cache: Improve versions fields handling
Firstly, don't store the versions fields in memory in the cache objects
data store. This just complicates the code for no good reason.

Secondly, write the version fields to all cache files, not just the
core one. This makes everything consistent and easier.

(Bitbake rev: cb666262b2f986b5d9331dfb30458ef1a151fa4d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:35 +01:00
Richard Purdie
09f6a56aa4 bitbake: cache: Correctly handle missing extra caches
If an "extras" cache file is corrupted, the system would not notice
and later fail with errors about missing entries. Add a test for this
which means we can fall back to re-parsing in those cases.

[YOCTO #9902]

(Bitbake rev: 51843d8f2bbe2e54db7593ca61984abe70423ef6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:34 +01:00
Richard Purdie
b2ef908be1 bitbake: cache: Move the parsing message to a more logical place
Otherwise you can look at the log and wonder why parsing isn't happening
when it really is due to other code paths.

(Bitbake rev: b48d95677a4d285a77cda2892179965f7f8f06dd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26 08:10:34 +01:00
458 changed files with 11501 additions and 8246 deletions

View File

@@ -10,4 +10,6 @@ Foundation and individual contributors.
* Twitter typeahead.js redistributed under the MIT license. Note that the JS source has one small modification, so the full unminified file is currently included to make it obvious where this is.
* jsrender is redistributed under the MIT license.
* QUnit is redistributed under the MIT license.

View File

@@ -59,7 +59,8 @@ webserverStartAll()
echo "Failed migrations, aborting system start" 1>&2
return $retval
fi
# Make sure that checksettings can pick up any value for TEMPLATECONF
export TEMPLATECONF
$MANAGE checksettings --traceback || retval=1
if [ $retval -eq 1 ]; then
@@ -100,7 +101,6 @@ stop_system()
fi
webserverKillAll
# unset exported variables
unset TOASTER_CONF
unset TOASTER_DIR
unset BITBAKE_UI
unset BBBASEDIR
@@ -153,23 +153,9 @@ if [ -n "$TEMPLATECONF" ]; then
if [ -d "$OEROOT/$TEMPLATECONF" ]; then
TEMPLATECONF="$OEROOT/$TEMPLATECONF"
fi
if [ ! -d "$TEMPLATECONF" ]; then
echo >&2 "Error: '$TEMPLATECONF' must be a directory containing toasterconf.json"
return 1
fi
fi
fi
if [ "$TOASTER_CONF" = "" ]; then
TOASTER_CONF="$TEMPLATECONF/toasterconf.json"
export TOASTER_CONF=$(python3 -c "import os; print(os.path.realpath('$TOASTER_CONF'))")
fi
if [ ! -f $TOASTER_CONF ]; then
echo "$TOASTER_CONF configuration file not found. Set TOASTER_CONF to specify file or fix .templateconf"
return 1
fi
# this defines the dir toaster will use for
# 1) clones of layers (in _toaster_clones )
# 2) the build dir (in build)
@@ -203,6 +189,10 @@ for param in $*; do
ADDR_PORT="localhost:$PORT"
fi
;;
--help)
echo "$HELP"
return 0
;;
*)
echo "$HELP"
return 1

View File

@@ -648,26 +648,7 @@
recipe and <filename>taskB</filename> for the second
recipe:
<literallayout class='monospaced'>
$ bitbake myfirstrecipe recipe:do_taskA mysecondrecipe recipe:do_taskB
</literallayout>
</para>
</section>
<section id='executing-a-list-of-task-and-recipe-combinations'>
<title>Executing a List of Task and Recipe Combinations</title>
<para>
The BitBake command line supports specifying different
tasks for individual targets when you specify multiple
targets.
For example, suppose you had two targets (or recipes)
<filename>myfirstrecipe</filename> and
<filename>mysecondrecipe</filename> and you needed
BitBake to run <filename>taskA</filename> for the first
recipe and <filename>taskB</filename> for the second
recipe:
<literallayout class='monospaced'>
$ bitbake myfirstrecipe recipe:do_taskA mysecondrecipe recipe:do_taskB
$ bitbake myfirstrecipe:do_taskA mysecondrecipe:do_taskB
</literallayout>
</para>
</section>

View File

@@ -50,22 +50,52 @@
<title>Variable Expansion</title>
<para>
BitBake supports variables referencing one another's
contents using a syntax that is similar to shell scripting.
Following is an example that results in <filename>A</filename>
containing "aval" and <filename>B</filename> evaluating to
"preavalpost" based on that current value of
<filename>A</filename>.
Variables can reference the contents of other variables
using a syntax that is similar to variable expansion in
Bourne shells.
The following assignments
result in A containing "aval" and B evaluating to "preavalpost".
<literallayout class='monospaced'>
A = "aval"
B = "pre${A}post"
</literallayout>
You should realize that whenever <filename>B</filename> is
referenced, its evaluation will depend on the state of
<filename>A</filename> at that time.
Thus, later evaluations of <filename>B</filename> in the
previous example could result in different values
depending on the value of <filename>A</filename>.
<note>
Unlike in Bourne shells, the curly braces are mandatory:
Only <filename>${FOO}</filename> and not
<filename>$FOO</filename> is recognized as an expansion of
<filename>FOO</filename>.
</note>
The "=" operator does not immediately expand variable
references in the right-hand side.
Instead, expansion is deferred until the variable assigned to
is actually used.
The result depends on the current values of the referenced
variables.
The following example should clarify this behavior:
<literallayout class='monospaced'>
A = "${B} baz"
B = "${C} bar"
C = "foo"
*At this point, ${A} equals "foo bar baz"*
C = "qux"
*At this point, ${A} equals "qux bar baz"*
B = "norf"
*At this point, ${A} equals "norf baz"*
</literallayout>
Contrast this behavior with the
<link linkend='immediate-variable-expansion'>immediate variable expansion</link>
operator (i.e. ":=").
</para>
<para>
If the variable expansion syntax is used on a variable that
does not exist, the string is kept as is.
For example, given the following assignment,
<filename>BAR</filename> expands to the literal string
"${FOO}" as long as <filename>FOO</filename> does not exist.
<literallayout class='monospaced'>
BAR = "${FOO}"
</literallayout>
</para>
</section>
@@ -259,6 +289,60 @@
"789 123456" and <filename>FOO2</filename> becomes
"ghi abcdef".
</para>
<para>
Like "_append" and "_prepend", "_remove"
is deferred until after parsing completes.
</para>
</section>
<section id='override-style-operation-advantages'>
<title>Override Style Operation Advantages</title>
<para>
An advantage of the override style operations
"_append", "_prepend", and "_remove" as compared to the
"+=" and "=+" operators is that the override style
operators provide guaranteed operations.
For example, consider a class <filename>foo.bbclass</filename>
that needs to add the value "val" to the variable
<filename>FOO</filename>, and a recipe that uses
<filename>foo.bbclass</filename> as follows:
<literallayout class='monospaced'>
inherit foo
FOO = "initial"
</literallayout>
If <filename>foo.bbclass</filename> uses the "+=" operator,
as follows, then the final value of <filename>FOO</filename>
will be "initial", which is not what is desired:
<literallayout class='monospaced'>
FOO += "val"
</literallayout>
If, on the other hand, <filename>foo.bbclass</filename>
uses the "_append" operator, then the final value of
<filename>FOO</filename> will be "initial val", as intended:
<literallayout class='monospaced'>
FOO_append = " val"
</literallayout>
<note>
It is never necessary to use "+=" together with "_append".
The following sequence of assignments appends "barbaz" to
<filename>FOO</filename>:
<literallayout class='monospaced'>
FOO_append = "bar"
FOO_append = "baz"
</literallayout>
The only effect of changing the second assignment in the
previous example to use "+=" would be to add a space before
"baz" in the appended value (due to how the "+=" operator
works).
</note>
Another advantage of the override style operations is that
you can combine them with other overrides as described in the
"<link linkend='conditional-syntax-overrides'>Conditional Syntax (Overrides)</link>"
section.
</para>
</section>
<section id='variable-flag-syntax'>
@@ -277,8 +361,7 @@
You can define, append, and prepend values to variable flags.
All the standard syntax operations previously mentioned work
for variable flags except for override style syntax
(i.e. <filename>_prepend</filename>, <filename>_append</filename>,
and <filename>_remove</filename>).
(i.e. "_prepend", "_append", and "_remove").
</para>
<para>
@@ -330,6 +413,21 @@
PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
</literallayout>
<note>
Inline Python expressions work just like variable expansions
insofar as the "=" and ":=" operators are concerned.
Given the following assignment, <filename>foo()</filename>
is called each time <filename>FOO</filename> is expanded:
<literallayout class='monospaced'>
FOO = "${@foo()}"
</literallayout>
Contrast this with the following immediate assignment, where
<filename>foo()</filename> is only called once, while the
assignment is parsed:
<literallayout class='monospaced'>
FOO := "${@foo()}"
</literallayout>
</note>
</para>
</section>
@@ -545,15 +643,15 @@
OVERRIDES = "foo"
A = "Y"
A_foo_append = "Z"
A_foo_append += "X"
A_foo_append = "X"
</literallayout>
For this case, before any overrides are resolved,
<filename>A</filename> is set to "Y" using an immediate assignment.
After this immediate assignment, <filename>A_foo</filename> is set
to "Z", and then further appended with
"X" leaving the variable set to "Z X".
"X" leaving the variable set to "ZX".
Finally, applying the override for "foo" results in the conditional
variable <filename>A</filename> becoming "Z X" (i.e.
variable <filename>A</filename> becoming "ZX" (i.e.
<filename>A</filename> is replaced with <filename>A_foo</filename>).
</para>
@@ -572,7 +670,7 @@
Initially, <filename>A</filename> is set to "1 45" because
of the three statements that use immediate operators.
After these assignments are made, BitBake applies the
<filename>_append</filename> operations.
"_append" operations.
Those operations result in <filename>A</filename> becoming "1 4523".
</para>
</section>

View File

@@ -1976,6 +1976,27 @@
The <filename>PROVIDES</filename> statement results in
the "libav" recipe also being known as "libpostproc".
</para>
<para>
In addition to providing recipes under alternate names,
the <filename>PROVIDES</filename> mechanism is also used
to implement virtual targets.
A virtual target is a name that corresponds to some
particular functionality (e.g. a Linux kernel).
Recipes that provide the functionality in question list the
virtual target in <filename>PROVIDES</filename>.
Recipes that depend on the functionality in question can
include the virtual target in
<link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>
to leave the choice of provider open.
</para>
<para>
Conventionally, virtual targets have names on the form
"virtual/function" (e.g. "virtual/kernel").
The slash is simply part of the name and has no
syntactical significance.
</para>
</glossdef>
</glossentry>

View File

@@ -385,39 +385,44 @@ exit $ret
else:
bb.warn('%s: invalid task progress varflag value "%s", ignoring' % (func, progress))
fifobuffer = bytearray()
def readfifo(data):
lines = data.split(b'\0')
for line in lines:
# Just skip empty commands
if not line:
continue
splitval = line.split(b' ', 1)
cmd = splitval[0].decode("utf-8")
if len(splitval) > 1:
value = splitval[1].decode("utf-8")
nonlocal fifobuffer
fifobuffer.extend(data)
while fifobuffer:
message, token, nextmsg = fifobuffer.partition(b"\00")
if token:
splitval = message.split(b' ', 1)
cmd = splitval[0].decode("utf-8")
if len(splitval) > 1:
value = splitval[1].decode("utf-8")
else:
value = ''
if cmd == 'bbplain':
bb.plain(value)
elif cmd == 'bbnote':
bb.note(value)
elif cmd == 'bbwarn':
bb.warn(value)
elif cmd == 'bberror':
bb.error(value)
elif cmd == 'bbfatal':
# The caller will call exit themselves, so bb.error() is
# what we want here rather than bb.fatal()
bb.error(value)
elif cmd == 'bbfatal_log':
bb.error(value, forcelog=True)
elif cmd == 'bbdebug':
splitval = value.split(' ', 1)
level = int(splitval[0])
value = splitval[1]
bb.debug(level, value)
else:
bb.warn("Unrecognised command '%s' on FIFO" % cmd)
fifobuffer = nextmsg
else:
value = ''
if cmd == 'bbplain':
bb.plain(value)
elif cmd == 'bbnote':
bb.note(value)
elif cmd == 'bbwarn':
bb.warn(value)
elif cmd == 'bberror':
bb.error(value)
elif cmd == 'bbfatal':
# The caller will call exit themselves, so bb.error() is
# what we want here rather than bb.fatal()
bb.error(value)
elif cmd == 'bbfatal_log':
bb.error(value, forcelog=True)
elif cmd == 'bbdebug':
splitval = value.split(' ', 1)
level = int(splitval[0])
value = splitval[1]
bb.debug(level, value)
else:
bb.warn("Unrecognised command '%s' on FIFO" % cmd)
break
tempdir = d.getVar('T', True)
fifopath = os.path.join(tempdir, 'fifo.%s' % os.getpid())
if os.path.exists(fifopath):

View File

@@ -280,72 +280,74 @@ class Cache(object):
cache_ok = True
if self.caches_array:
for cache_class in self.caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
cache_ok = cache_ok and os.path.exists(cachefile)
cache_class.init_cacheData(self)
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
cache_ok = cache_ok and os.path.exists(cachefile)
cache_class.init_cacheData(self)
if cache_ok:
self.load_cachefile()
elif os.path.isfile(self.cachefile):
logger.info("Out of date cache found, rebuilding...")
def load_cachefile(self):
# Firstly, using core cache file information for
# valid checking
with open(self.cachefile, "rb") as cachefile:
pickled = pickle.Unpickler(cachefile)
try:
cache_ver = pickled.load()
bitbake_ver = pickled.load()
except Exception:
logger.info('Invalid cache, rebuilding...')
return
if cache_ver != __cache_version__:
logger.info('Cache version mismatch, rebuilding...')
return
elif bitbake_ver != bb.__version__:
logger.info('Bitbake version mismatch, rebuilding...')
return
cachesize = 0
previous_progress = 0
previous_percent = 0
# Calculate the correct cachesize of all those cache files
for cache_class in self.caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
with open(cachefile, "rb") as cachefile:
cachesize += os.fstat(cachefile.fileno()).st_size
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
with open(cachefile, "rb") as cachefile:
cachesize += os.fstat(cachefile.fileno()).st_size
bb.event.fire(bb.event.CacheLoadStarted(cachesize), self.data)
for cache_class in self.caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
with open(cachefile, "rb") as cachefile:
pickled = pickle.Unpickler(cachefile)
while cachefile:
try:
key = pickled.load()
value = pickled.load()
except Exception:
break
if key in self.depends_cache:
self.depends_cache[key].append(value)
else:
self.depends_cache[key] = [value]
# only fire events on even percentage boundaries
current_progress = cachefile.tell() + previous_progress
current_percent = 100 * current_progress / cachesize
if current_percent > previous_percent:
previous_percent = current_percent
bb.event.fire(bb.event.CacheLoadProgress(current_progress, cachesize),
self.data)
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
with open(cachefile, "rb") as cachefile:
pickled = pickle.Unpickler(cachefile)
# Check cache version information
try:
cache_ver = pickled.load()
bitbake_ver = pickled.load()
except Exception:
logger.info('Invalid cache, rebuilding...')
return
previous_progress += current_progress
if cache_ver != __cache_version__:
logger.info('Cache version mismatch, rebuilding...')
return
elif bitbake_ver != bb.__version__:
logger.info('Bitbake version mismatch, rebuilding...')
return
# Load the rest of the cache file
current_progress = 0
while cachefile:
try:
key = pickled.load()
value = pickled.load()
except Exception:
break
if not isinstance(key, str):
bb.warn("%s from extras cache is not a string?" % key)
break
if not isinstance(value, RecipeInfoCommon):
bb.warn("%s from extras cache is not a RecipeInfoCommon class?" % value)
break
if key in self.depends_cache:
self.depends_cache[key].append(value)
else:
self.depends_cache[key] = [value]
# only fire events on even percentage boundaries
current_progress = cachefile.tell() + previous_progress
current_percent = 100 * current_progress / cachesize
if current_percent > previous_percent:
previous_percent = current_percent
bb.event.fire(bb.event.CacheLoadProgress(current_progress, cachesize),
self.data)
previous_progress += current_progress
# Note: depends cache number is corresponding to the parsing file numbers.
# The same file has several caches, still regarded as one item in the cache
@@ -395,6 +397,7 @@ class Cache(object):
@classmethod
def parse(cls, filename, appends, configdata, caches_array):
"""Parse the specified filename, returning the recipe information"""
logger.debug(1, "Parsing %s", filename)
infos = []
datastores = cls.load_bbfile(filename, appends, configdata)
depends = []
@@ -408,9 +411,8 @@ class Cache(object):
info_array = []
for cache_class in caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
info = cache_class(filename, data)
info_array.append(info)
info = cache_class(filename, data)
info_array.append(info)
infos.append((virtualfn, info_array))
return infos
@@ -432,7 +434,6 @@ class Cache(object):
virtualfn = self.realfn2virtual(filename, variant)
infos.append((virtualfn, self.depends_cache[virtualfn]))
else:
logger.debug(1, "Parsing %s", filename)
return self.parse(filename, appends, configdata, self.caches_array)
return cached, infos
@@ -556,6 +557,9 @@ class Cache(object):
if virtualfn not in self.depends_cache:
logger.debug(2, "Cache: %s is not cached", virtualfn)
invalid = True
elif len(self.depends_cache[virtualfn]) != len(self.caches_array):
logger.debug(2, "Cache: Extra caches missing for %s?" % virtualfn)
invalid = True
# If any one of the variants is not present, mark as invalid for all
if invalid:
@@ -597,30 +601,19 @@ class Cache(object):
logger.debug(2, "Cache is clean, not saving.")
return
file_dict = {}
pickler_dict = {}
for cache_class in self.caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cache_class_name = cache_class.__name__
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
file_dict[cache_class_name] = open(cachefile, "wb")
pickler_dict[cache_class_name] = pickle.Pickler(file_dict[cache_class_name], pickle.HIGHEST_PROTOCOL)
pickler_dict['CoreRecipeInfo'].dump(__cache_version__)
pickler_dict['CoreRecipeInfo'].dump(bb.__version__)
cache_class_name = cache_class.__name__
cachefile = getCacheFile(self.cachedir, cache_class.cachefile, self.data_hash)
with open(cachefile, "wb") as f:
p = pickle.Pickler(f, pickle.HIGHEST_PROTOCOL)
p.dump(__cache_version__)
p.dump(bb.__version__)
try:
for key, info_array in self.depends_cache.items():
for info in info_array:
if isinstance(info, RecipeInfoCommon):
cache_class_name = info.__class__.__name__
pickler_dict[cache_class_name].dump(key)
pickler_dict[cache_class_name].dump(info)
finally:
for cache_class in self.caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cache_class_name = cache_class.__name__
file_dict[cache_class_name].close()
for key, info_array in self.depends_cache.items():
for info in info_array:
if isinstance(info, RecipeInfoCommon) and info.__class__.__name__ == cache_class_name:
p.dump(key)
p.dump(info)
del self.depends_cache
@@ -652,8 +645,7 @@ class Cache(object):
info_array = []
for cache_class in self.caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
info_array.append(cache_class(realfn, data))
info_array.append(cache_class(realfn, data))
self.add_info(file_name, info_array, cacheData, parsed)
@staticmethod
@@ -721,8 +713,9 @@ class CacheData(object):
def __init__(self, caches_array):
self.caches_array = caches_array
for cache_class in self.caches_array:
if type(cache_class) is type and issubclass(cache_class, RecipeInfoCommon):
cache_class.init_cacheData(self)
if not issubclass(cache_class, RecipeInfoCommon):
bb.error("Extra cache data class %s should subclass RecipeInfoCommon class" % cache_class)
cache_class.init_cacheData(self)
# Direct cache variables
self.task_queues = {}

View File

@@ -120,13 +120,15 @@ class FileChecksumCache(MultiProcessCache):
checksums.extend(checksum_dir(f))
else:
checksum = checksum_file(f)
checksums.append((f, checksum))
if checksum:
checksums.append((f, checksum))
elif os.path.isdir(pth):
if not os.path.islink(pth):
checksums.extend(checksum_dir(pth))
else:
checksum = checksum_file(pth)
checksums.append((pth, checksum))
if checksum:
checksums.append((pth, checksum))
checksums.sort(key=operator.itemgetter(1))
return checksums

View File

@@ -1235,6 +1235,7 @@ class BBCooker:
"""
Build the file matching regexp buildfile
"""
bb.event.fire(bb.event.BuildInit(), self.expanded_data)
# Too many people use -b because they think it's how you normally
# specify a target to be built, so show a warning
@@ -1377,6 +1378,9 @@ class BBCooker:
if not task.startswith("do_"):
task = "do_%s" % task
packages = ["%s:%s" % (target, task) for target in targets]
bb.event.fire(bb.event.BuildInit(packages), self.expanded_data)
taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort)
buildname = self.data.getVar("BUILDNAME", False)

View File

@@ -382,7 +382,11 @@ class BuildBase(Event):
class BuildInit(BuildBase):
"""buildFile or buildTargets was invoked"""
def __init__(self, p=[]):
name = None
BuildBase.__init__(self, name, p)
class BuildStarted(BuildBase, OperationStarted):
"""bbmake build run started"""

View File

@@ -664,7 +664,7 @@ def verify_donestamp(ud, d, origud=None):
# as an upgrade path from the previous done stamp file format.
if checksums != precomputed_checksums:
with open(ud.donestamp, "wb") as cachefile:
p = pickle.Pickler(cachefile, pickle.HIGHEST_PROTOCOL)
p = pickle.Pickler(cachefile, 2)
p.dump(checksums)
return True
except ChecksumError as e:
@@ -698,7 +698,7 @@ def update_stamp(ud, d):
checksums = verify_checksum(ud, d)
# Store the checksums for later re-verification against the recipe
with open(ud.donestamp, "wb") as cachefile:
p = pickle.Pickler(cachefile, pickle.HIGHEST_PROTOCOL)
p = pickle.Pickler(cachefile, 2)
p.dump(checksums)
except ChecksumError as e:
# Checksums failed to verify, trigger re-download and remove the
@@ -832,7 +832,7 @@ def runfetchcmd(cmd, d, quiet=False, cleanup=None, log=None):
output = "output:\n%s" % e.stderr
else:
output = "no output"
error_message = "Fetch command failed with exit code %s, %s" % (e.exitcode, output)
error_message = "Fetch command %s failed with exit code %s, %s" % (e.command, e.exitcode, output)
except bb.process.CmdError as e:
error_message = "Fetch command %s could not be run:\n%s" % (e.command, e.msg)
if not success:
@@ -1431,7 +1431,7 @@ class FetchMethod(object):
if urlpath.find("/") != -1:
destdir = urlpath.rsplit("/", 1)[0] + '/'
bb.utils.mkdirhier("%s/%s" % (unpackdir, destdir))
cmd = 'cp -fpPR %s %s' % (file, destdir)
cmd = 'cp -fpPRH %s %s' % (file, destdir)
if not cmd:
return

View File

@@ -106,7 +106,7 @@ class Bzr(FetchMethod):
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude '.bzr' --exclude '.bzrtags'"
tar_flags = "--exclude='.bzr' --exclude='.bzrtags'"
# tar them up to a defined filename
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.basename(ud.pkgdir)), d, cleanup = [ud.localpath])

View File

@@ -147,7 +147,7 @@ class Cvs(FetchMethod):
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude 'CVS'"
tar_flags = "--exclude='CVS'"
# tar them up to a defined filename
if 'fullpath' in ud.parm:

View File

@@ -66,7 +66,7 @@ class GitANNEX(Git):
os.chdir(ud.destdir)
try:
runfetchcmd("%s annex sync" % (ud.basecmd), d)
runfetchcmd("%s annex init" % (ud.basecmd), d)
except bb.fetch.FetchError:
pass

View File

@@ -83,7 +83,7 @@ class Repo(FetchMethod):
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude '.repo' --exclude '.git'"
tar_flags = "--exclude='.repo' --exclude='.git'"
# Create a cache
runfetchcmd("tar %s -czf %s %s" % (tar_flags, ud.localpath, os.path.join(".", "*") ), d)

View File

@@ -150,7 +150,7 @@ class Svn(FetchMethod):
if scmdata == "keep":
tar_flags = ""
else:
tar_flags = "--exclude '.svn'"
tar_flags = "--exclude='.svn'"
os.chdir(ud.pkgdir)
# tar them up to a defined filename

View File

@@ -131,14 +131,14 @@ class SQLTable(collections.MutableMapping):
return [row[1] for row in data]
def values(self):
return list(self.values())
return list(self.itervalues())
def itervalues(self):
data = self._execute("SELECT value FROM %s;" % self.table)
return (row[0] for row in data)
def items(self):
return list(self.items())
return list(self.iteritems())
def iteritems(self):
return self._execute("SELECT * FROM %s;" % self.table)

View File

@@ -234,10 +234,13 @@ class MultiStageProcessProgressReporter(MultiStageProgressReporter):
"""
def __init__(self, d, processname, stage_weights, debug=False):
self._processname = processname
self._started = False
MultiStageProgressReporter.__init__(self, d, stage_weights, debug)
def start(self):
bb.event.fire(bb.event.ProcessStarted(self._processname, 100), self._data)
if not self._started:
bb.event.fire(bb.event.ProcessStarted(self._processname, 100), self._data)
self._started = True
def _fire_progress(self, taskprogress):
if taskprogress == 0:

View File

@@ -293,11 +293,11 @@ class SignatureGeneratorBasic(SignatureGenerator):
computed_basehash = calc_basehash(data)
if computed_basehash != self.basehash[k]:
bb.error("Basehash mismatch %s verses %s for %s" % (computed_basehash, self.basehash[k], k))
bb.error("Basehash mismatch %s versus %s for %s" % (computed_basehash, self.basehash[k], k))
if runtime and k in self.taskhash:
computed_taskhash = calc_taskhash(data)
if computed_taskhash != self.taskhash[k]:
bb.error("Taskhash mismatch %s verses %s for %s" % (computed_taskhash, self.taskhash[k], k))
bb.error("Taskhash mismatch %s versus %s for %s" % (computed_taskhash, self.taskhash[k], k))
def dump_sigs(self, dataCache, options):

View File

@@ -150,55 +150,33 @@ class ORMWrapper(object):
# pylint: disable=bad-continuation
# we do not follow the python conventions for continuation indentation due to long lines here
def create_build_object(self, build_info, brbe, project_id):
assert 'machine' in build_info
assert 'distro' in build_info
assert 'distro_version' in build_info
assert 'started_on' in build_info
assert 'cooker_log_path' in build_info
assert 'build_name' in build_info
assert 'bitbake_version' in build_info
def get_or_create_build_object(self, brbe):
prj = None
buildrequest = None
if brbe is not None: # this build was triggered by a request from a user
if brbe is not None:
# Toaster-triggered build
logger.debug(1, "buildinfohelper: brbe is %s" % brbe)
br, _ = brbe.split(":")
buildrequest = BuildRequest.objects.get(pk = br)
buildrequest = BuildRequest.objects.get(pk=br)
prj = buildrequest.project
elif project_id is not None: # this build was triggered by an external system for a specific project
logger.debug(1, "buildinfohelper: project is %s" % prj)
prj = Project.objects.get(pk = project_id)
else: # this build was triggered by a legacy system, or command line interactive mode
else:
# CLI build
prj = Project.objects.get_or_create_default_project()
logger.debug(1, "buildinfohelper: project is not specified, defaulting to %s" % prj)
if buildrequest is not None:
# reuse existing Build object
build = buildrequest.build
logger.info("Updating existing build, with %s", build_info)
build.project = prj
build.machine=build_info['machine']
build.distro=build_info['distro']
build.distro_version=build_info['distro_version']
build.cooker_log_path=build_info['cooker_log_path']
build.build_name=build_info['build_name']
build.bitbake_version=build_info['bitbake_version']
build.save()
else:
# create new Build object
now = timezone.now()
build = Build.objects.create(
project = prj,
machine=build_info['machine'],
distro=build_info['distro'],
distro_version=build_info['distro_version'],
started_on=build_info['started_on'],
completed_on=build_info['started_on'],
cooker_log_path=build_info['cooker_log_path'],
build_name=build_info['build_name'],
bitbake_version=build_info['bitbake_version'])
project=prj,
started_on=now,
completed_on=now,
build_name='')
logger.debug(1, "buildinfohelper: build is created %s" % build)
@@ -208,6 +186,11 @@ class ORMWrapper(object):
return build
def update_build(self, build, data_dict):
for key in data_dict:
setattr(build, key, data_dict[key])
build.save()
@staticmethod
def get_or_create_targets(target_info):
"""
@@ -230,7 +213,7 @@ class ORMWrapper(object):
result.append(obj)
return result
def update_build_object(self, build, errors, warnings, taskfailures):
def update_build_stats_and_outcome(self, build, errors, warnings, taskfailures):
assert isinstance(build,Build)
assert isinstance(errors, int)
assert isinstance(warnings, int)
@@ -393,7 +376,7 @@ class ORMWrapper(object):
layer_copy, c = Layer_Version.objects.get_or_create(
build=build_obj,
layer=layer_obj.layer,
up_branch=layer_obj.up_branch,
release=layer_obj.release,
branch=layer_version_information['branch'],
commit=layer_version_information['commit'],
local_path=layer_version_information['local_path'],
@@ -436,13 +419,24 @@ class ORMWrapper(object):
assert 'name' in layer_information
assert 'layer_index_url' in layer_information
# From command line builds we have no brbe as the request is directly
# from bitbake
if brbe is None:
layer_object, _ = Layer.objects.get_or_create(
name=layer_information['name'],
layer_index_url=layer_information['layer_index_url'])
# If we don't have git commit sha then we're using a non-git
# layer so set the layer_source_dir to identify it as such
if not layer_information['version']['commit']:
local_source_dir = layer_information["local_path"]
else:
local_source_dir = None
layer_object, _ = \
Layer.objects.get_or_create(
name=layer_information['name'],
local_source_dir=local_source_dir,
layer_index_url=layer_information['layer_index_url'])
return layer_object
else:
# we are under managed mode; we must match the layer used in the Project Layer
br_id, be_id = brbe.split(":")
# find layer by checkout path;
@@ -467,6 +461,11 @@ class ORMWrapper(object):
if brl.layer_version:
return brl.layer_version
# This might be a local layer (i.e. no git info) so try
# matching local_source_dir
if brl.local_source_dir and brl.local_source_dir == layer_information["local_path"]:
return brl.layer_version
# we matched the BRLayer, but we need the layer_version that generated this BR; reverse of the Project.schedule_build()
#logger.debug(1, "Matched %s to BRlayer %s" % (pformat(layer_information["local_path"]), localdirname))
@@ -625,8 +624,8 @@ class ORMWrapper(object):
Recipe,
name=built_recipe.name,
layer_version__build=None,
layer_version__up_branch=
built_recipe.layer_version.up_branch,
layer_version__release=
built_recipe.layer_version.release,
file_path=built_recipe.file_path,
version=built_recipe.version
)
@@ -915,22 +914,55 @@ class BuildInfoHelper(object):
###################
## methods to convert event/external info into objects that the ORM layer uses
def _ensure_build(self):
"""
Ensure the current build object exists and is up to date with
data on the bitbake server
"""
if not 'build' in self.internal_state or not self.internal_state['build']:
# create the Build object
self.internal_state['build'] = \
self.orm_wrapper.get_or_create_build_object(self.brbe)
def _get_build_information(self, build_log_path):
build = self.internal_state['build']
# update missing fields on the Build object with found data
build_info = {}
build_info['machine'] = self.server.runCommand(["getVariable", "MACHINE"])[0]
build_info['distro'] = self.server.runCommand(["getVariable", "DISTRO"])[0]
build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
build_info['started_on'] = timezone.now()
build_info['completed_on'] = timezone.now()
build_info['cooker_log_path'] = build_log_path
build_info['build_name'] = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
build_info['project'] = self.project = self.server.runCommand(["getVariable", "TOASTER_PROJECT"])[0]
return build_info
# set to True if at least one field is going to be set
changed = False
if not build.build_name:
build_name = self.server.runCommand(["getVariable", "BUILDNAME"])[0]
# only reset the build name if the one on the server is actually
# a valid value for the build_name field
if build_name != None:
build_info['build_name'] = build_name
changed = True
if not build.machine:
build_info['machine'] = self.server.runCommand(["getVariable", "MACHINE"])[0]
changed = True
if not build.distro:
build_info['distro'] = self.server.runCommand(["getVariable", "DISTRO"])[0]
changed = True
if not build.distro_version:
build_info['distro_version'] = self.server.runCommand(["getVariable", "DISTRO_VERSION"])[0]
changed = True
if not build.bitbake_version:
build_info['bitbake_version'] = self.server.runCommand(["getVariable", "BB_VERSION"])[0]
changed = True
if changed:
self.orm_wrapper.update_build(self.internal_state['build'], build_info)
def _get_task_information(self, event, recipe):
assert 'taskname' in vars(event)
self._ensure_build()
task_information = {}
task_information['build'] = self.internal_state['build']
@@ -945,8 +977,9 @@ class BuildInfoHelper(object):
return task_information
def _get_layer_version_for_path(self, path):
self._ensure_build()
assert path.startswith("/")
assert 'build' in self.internal_state
def _slkey_interactive(layer_version):
assert isinstance(layer_version, Layer_Version)
@@ -957,6 +990,9 @@ class BuildInfoHelper(object):
# we can match to the recipe file path
if path.startswith(lvo.local_path):
return lvo
if lvo.layer.local_source_dir and \
path.startswith(lvo.layer.local_source_dir):
return lvo
#if we get here, we didn't read layers correctly; dump whatever information we have on the error log
logger.warning("Could not match layer version for recipe path %s : %s", path, self.orm_wrapper.layer_version_objects)
@@ -990,6 +1026,8 @@ class BuildInfoHelper(object):
return recipe_info
def _get_path_information(self, task_object):
self._ensure_build()
assert isinstance(task_object, Task)
build_stats_format = "{tmpdir}/buildstats/{buildname}/{package}/"
build_stats_path = []
@@ -1032,17 +1070,31 @@ class BuildInfoHelper(object):
except NotExisting as nee:
logger.warning("buildinfohelper: cannot identify layer exception:%s ", nee)
def store_started_build(self):
self._ensure_build()
def store_started_build(self, event, build_log_path):
def save_build_log_file_path(self, build_log_path):
self._ensure_build()
if not self.internal_state['build'].cooker_log_path:
data_dict = {'cooker_log_path': build_log_path}
self.orm_wrapper.update_build(self.internal_state['build'], data_dict)
def save_build_targets(self, event):
self._ensure_build()
# create target information
assert '_pkgs' in vars(event)
build_information = self._get_build_information(build_log_path)
target_information = {}
target_information['targets'] = event._pkgs
target_information['build'] = self.internal_state['build']
# Update brbe and project as they can be changed for every build
self.project = build_information['project']
self.internal_state['targets'] = self.orm_wrapper.get_or_create_targets(target_information)
build_obj = self.orm_wrapper.create_build_object(build_information, self.brbe, self.project)
def save_build_layers_and_variables(self):
self._ensure_build()
self.internal_state['build'] = build_obj
build_obj = self.internal_state['build']
# save layer version information for this build
if not 'lvs' in self.internal_state:
@@ -1053,13 +1105,6 @@ class BuildInfoHelper(object):
del self.internal_state['lvs']
# create target information
target_information = {}
target_information['targets'] = event._pkgs
target_information['build'] = build_obj
self.internal_state['targets'] = self.orm_wrapper.get_or_create_targets(target_information)
# Save build configuration
data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0]
@@ -1090,9 +1135,48 @@ class BuildInfoHelper(object):
return self.brbe
def set_recipes_to_parse(self, num_recipes):
"""
Set the number of recipes which need to be parsed for this build.
This is set the first time ParseStarted is received by toasterui.
"""
self._ensure_build()
self.internal_state['build'].recipes_to_parse = num_recipes
self.internal_state['build'].save()
def set_recipes_parsed(self, num_recipes):
"""
Set the number of recipes parsed so far for this build; this is updated
each time a ParseProgress or ParseCompleted event is received by
toasterui.
"""
self._ensure_build()
if num_recipes <= self.internal_state['build'].recipes_to_parse:
self.internal_state['build'].recipes_parsed = num_recipes
self.internal_state['build'].save()
def update_target_image_file(self, event):
evdata = BuildInfoHelper._get_data_from_event(event)
for t in self.internal_state['targets']:
if t.is_image == True:
output_files = list(evdata.keys())
for output in output_files:
if t.target in output and 'rootfs' in output and not output.endswith(".manifest"):
self.orm_wrapper.save_target_image_file_information(t, output, evdata[output])
def update_artifact_image_file(self, event):
self._ensure_build()
evdata = BuildInfoHelper._get_data_from_event(event)
for artifact_path in evdata.keys():
self.orm_wrapper.save_artifact_information(
self.internal_state['build'], artifact_path,
evdata[artifact_path])
def update_build_information(self, event, errors, warnings, taskfailures):
if 'build' in self.internal_state:
self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures)
self._ensure_build()
self.orm_wrapper.update_build_stats_and_outcome(
self.internal_state['build'], errors, warnings, taskfailures)
def store_started_task(self, event):
assert isinstance(event, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped))
@@ -1135,6 +1219,7 @@ class BuildInfoHelper(object):
def store_tasks_stats(self, event):
self._ensure_build()
task_data = BuildInfoHelper._get_data_from_event(event)
for (task_file, task_name, task_stats, recipe_name) in task_data:
@@ -1230,6 +1315,8 @@ class BuildInfoHelper(object):
def store_target_package_data(self, event):
self._ensure_build()
# for all image targets
for target in self.internal_state['targets']:
if target.is_image:
@@ -1263,10 +1350,9 @@ class BuildInfoHelper(object):
note that this only gets called for command line builds which are
interrupted, so it doesn't touch any BuildRequest objects
"""
build = self.internal_state['build']
if build:
build.outcome = Build.CANCELLED
build.save()
self._ensure_build()
self.internal_state['build'].outcome = Build.CANCELLED
self.internal_state['build'].save()
def store_dependency_information(self, event):
assert '_depgraph' in vars(event)
@@ -1412,6 +1498,8 @@ class BuildInfoHelper(object):
def store_build_package_information(self, event):
self._ensure_build()
package_info = BuildInfoHelper._get_data_from_event(event)
self.orm_wrapper.save_build_package_information(
self.internal_state['build'],
@@ -1427,6 +1515,10 @@ class BuildInfoHelper(object):
def _store_build_done(self, errorcode):
logger.info("Build exited with errorcode %d", errorcode)
if not self.brbe:
return
br_id, be_id = self.brbe.split(":")
be = BuildEnvironment.objects.get(pk = be_id)
be.lock = BuildEnvironment.LOCK_LOCK
@@ -1448,7 +1540,6 @@ class BuildInfoHelper(object):
br.state = BuildRequest.REQ_FAILED
br.save()
def store_log_error(self, text):
mockevent = MockEvent()
mockevent.levelno = formatter.ERROR
@@ -1467,24 +1558,22 @@ class BuildInfoHelper(object):
def store_log_event(self, event):
self._ensure_build()
if event.levelno < formatter.WARNING:
return
if 'args' in vars(event):
event.msg = event.msg % event.args
if not 'build' in self.internal_state:
if self.brbe is None:
if not 'backlog' in self.internal_state:
self.internal_state['backlog'] = []
self.internal_state['backlog'].append(event)
return
else: # we're under Toaster control, the build is already created
br, _ = self.brbe.split(":")
buildrequest = BuildRequest.objects.get(pk = br)
self.internal_state['build'] = buildrequest.build
# early return for CLI builds
if self.brbe is None:
if not 'backlog' in self.internal_state:
self.internal_state['backlog'] = []
self.internal_state['backlog'].append(event)
return
if 'build' in self.internal_state and 'backlog' in self.internal_state:
if 'backlog' in self.internal_state:
# if we have a backlog of events, do our best to save them here
if len(self.internal_state['backlog']):
tempevent = self.internal_state['backlog'].pop()
@@ -1813,18 +1902,12 @@ class BuildInfoHelper(object):
sdk_target)
def close(self, errorcode):
if self.brbe is not None:
self._store_build_done(errorcode)
self._store_build_done(errorcode)
if 'backlog' in self.internal_state:
if 'build' in self.internal_state:
# we save missed events in the database for the current build
tempevent = self.internal_state['backlog'].pop()
self.store_log_event(tempevent)
else:
# we have no build, and we still have events; something amazingly wrong happend
for event in self.internal_state['backlog']:
logger.error("UNSAVED log: %s", event.msg)
# we save missed events in the database for the current build
tempevent = self.internal_state['backlog'].pop()
self.store_log_event(tempevent)
if not connection.features.autocommits_when_autocommit_is_off:
transaction.set_autocommit(True)
@@ -1833,3 +1916,7 @@ class BuildInfoHelper(object):
# being incorrectly attached to the previous Toaster-triggered build;
# see https://bugzilla.yoctoproject.org/show_bug.cgi?id=9021
self.brbe = None
# unset the internal Build object to prevent it being reused for the
# next build
self.internal_state['build'] = None

View File

@@ -40,9 +40,9 @@ logger = logging.getLogger("BitBake")
interactive = sys.stdout.isatty()
class BBProgress(progressbar.ProgressBar):
def __init__(self, msg, maxval, widgets=None):
def __init__(self, msg, maxval, widgets=None, extrapos=-1):
self.msg = msg
self.extrapos = -1
self.extrapos = extrapos
if not widgets:
widgets = [progressbar.Percentage(), ' ', progressbar.Bar(), ' ',
progressbar.ETA()]
@@ -69,15 +69,16 @@ class BBProgress(progressbar.ProgressBar):
self.widgets[0] = msg
def setextra(self, extra):
if extra:
extrastr = str(extra)
if extrastr[0] != ' ':
extrastr = ' ' + extrastr
if extrastr[-1] != ' ':
extrastr += ' '
else:
extrastr = ' '
self.widgets[self.extrapos] = extrastr
if self.extrapos > -1:
if extra:
extrastr = str(extra)
if extrastr[0] != ' ':
extrastr = ' ' + extrastr
if extrastr[-1] != ' ':
extrastr += ' '
else:
extrastr = ' '
self.widgets[self.extrapos] = extrastr
def _need_update(self):
# We always want the bar to print when update() is called
@@ -241,10 +242,10 @@ class TerminalFilter(object):
start_time = activetasks[t].get("starttime", None)
if not pbar or pbar.bouncing != (progress < 0):
if progress < 0:
pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.BouncingSlider()])
pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.BouncingSlider(), ''], extrapos=2)
pbar.bouncing = True
else:
pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100)
pbar = BBProgress("0: %s (pid %s) " % (activetasks[t]["title"], t), 100, widgets=[progressbar.Percentage(), ' ', progressbar.Bar(), ''], extrapos=4)
pbar.bouncing = False
activetasks[t]["progressbar"] = pbar
tasks.append((pbar, progress, rate, start_time))

View File

@@ -102,6 +102,7 @@ _evt_list = [
"bb.command.CommandExit",
"bb.command.CommandFailed",
"bb.cooker.CookerExit",
"bb.event.BuildInit",
"bb.event.BuildCompleted",
"bb.event.BuildStarted",
"bb.event.CacheLoadCompleted",
@@ -115,6 +116,7 @@ _evt_list = [
"bb.event.NoProvider",
"bb.event.ParseCompleted",
"bb.event.ParseProgress",
"bb.event.ParseStarted",
"bb.event.RecipeParsed",
"bb.event.SanityCheck",
"bb.event.SanityCheckPassed",
@@ -231,19 +233,35 @@ def main(server, eventHandler, params):
# pylint: disable=protected-access
# the code will look into the protected variables of the event; no easy way around this
# we treat ParseStarted as the first event of toaster-triggered
# builds; that way we get the Build Configuration included in the log
# and any errors that occur before BuildStarted is fired
if isinstance(event, bb.event.ParseStarted):
if not (build_log and build_log_file_path):
build_log, build_log_file_path = _open_build_log(log_dir)
buildinfohelper.store_started_build()
buildinfohelper.save_build_log_file_path(build_log_file_path)
buildinfohelper.set_recipes_to_parse(event.total)
continue
if isinstance(event, bb.event.BuildStarted):
# create a build object in buildinfohelper from either BuildInit
# (if available) or BuildStarted (for jethro and previous versions)
if isinstance(event, (bb.event.BuildStarted, bb.event.BuildInit)):
if not (build_log and build_log_file_path):
build_log, build_log_file_path = _open_build_log(log_dir)
buildinfohelper.store_started_build(event, build_log_file_path)
buildinfohelper.save_build_targets(event)
buildinfohelper.save_build_log_file_path(build_log_file_path)
# get additional data from BuildStarted
if isinstance(event, bb.event.BuildStarted):
buildinfohelper.save_build_layers_and_variables()
continue
if isinstance(event, bb.event.ParseProgress):
buildinfohelper.set_recipes_parsed(event.current)
continue
if isinstance(event, bb.event.ParseCompleted):
buildinfohelper.set_recipes_parsed(event.total)
continue
if isinstance(event, (bb.build.TaskStarted, bb.build.TaskSucceeded, bb.build.TaskFailedSilent)):
@@ -289,10 +307,6 @@ def main(server, eventHandler, params):
# timing and error informations from the parsing phase in Toaster
if isinstance(event, (bb.event.SanityCheckPassed, bb.event.SanityCheck)):
continue
if isinstance(event, bb.event.ParseProgress):
continue
if isinstance(event, bb.event.ParseCompleted):
continue
if isinstance(event, bb.event.CacheLoadStarted):
continue
if isinstance(event, bb.event.CacheLoadProgress):

View File

@@ -375,6 +375,12 @@ def _print_exception(t, value, tb, realfile, text, context):
level = level + 1
error.append("Exception: %s" % ''.join(exception))
# If the exception is from spwaning a task, let's be helpful and display
# the output (which hopefully includes stderr).
if isinstance(value, subprocess.CalledProcessError):
error.append("Subprocess output:")
error.append(value.output.decode("utf-8", errors="ignore"))
finally:
logger.error("\n".join(error))

View File

@@ -1,33 +1,33 @@
from django.contrib import admin
from django.contrib.admin.filters import RelatedFieldListFilter
from orm.models import BitbakeVersion, Release, LayerSource, ToasterSetting
from django.forms.widgets import Textarea
from orm.models import BitbakeVersion, Release, ToasterSetting, Layer_Version
from django import forms
import django.db.models as models
from django.contrib.admin import widgets, helpers
class LayerSourceAdmin(admin.ModelAdmin):
pass
class BitbakeVersionAdmin(admin.ModelAdmin):
# we override the formfield for db URLField because of broken URL validation
# we override the formfield for db URLField
# because of broken URL validation
def formfield_for_dbfield(self, db_field, **kwargs):
if isinstance(db_field, models.fields.URLField):
return forms.fields.CharField()
return super(BitbakeVersionAdmin, self).formfield_for_dbfield(db_field, **kwargs)
return super(BitbakeVersionAdmin, self).formfield_for_dbfield(
db_field, **kwargs)
class ReleaseAdmin(admin.ModelAdmin):
pass
class ToasterSettingAdmin(admin.ModelAdmin):
pass
admin.site.register(LayerSource, LayerSourceAdmin)
class LayerVersionsAdmin(admin.ModelAdmin):
pass
admin.site.register(Layer_Version, LayerVersionsAdmin)
admin.site.register(BitbakeVersion, BitbakeVersionAdmin)
admin.site.register(Release, ReleaseAdmin)
admin.site.register(ToasterSetting, ToasterSettingAdmin)

View File

@@ -89,6 +89,10 @@ class LocalhostBEController(BuildEnvironmentController):
""" a word of attention: by convention, the first layer for any build will be poky! """
assert self.be.sourcedir is not None
layerlist = []
nongitlayerlist = []
# set layers in the layersource
# 1. get a list of repos with branches, and map dirpaths for each layer
@@ -102,6 +106,13 @@ class LocalhostBEController(BuildEnvironmentController):
# as it's generated by us layer on if needed
if CustomImageRecipe.LAYER_NAME in layer.name:
continue
# If we have local layers then we don't need clone them
# For local layers giturl will be empty
if not layer.giturl:
nongitlayerlist.append(layer.layer_version.layer.local_source_dir)
continue
if not (layer.giturl, layer.commit) in gitrepos:
gitrepos[(layer.giturl, layer.commit)] = []
gitrepos[(layer.giturl, layer.commit)].append( (layer.name, layer.dirpath) )
@@ -131,7 +142,6 @@ class LocalhostBEController(BuildEnvironmentController):
logger.info("Using pre-checked out source for layer %s", cached_layers)
layerlist = []
# 3. checkout the repositories
@@ -245,6 +255,7 @@ class LocalhostBEController(BuildEnvironmentController):
layerlist.append(layerpath)
self.islayerset = True
layerlist.extend(nongitlayerlist)
return layerlist
def readServerLogFile(self):

View File

@@ -1,10 +1,15 @@
from django.core.management.base import NoArgsCommand, CommandError
from django.db import transaction
from django.core.management import call_command
from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException
from bldcontrol.models import BuildRequest, BuildEnvironment, BRError
from orm.models import ToasterSetting, Build
from orm.models import ToasterSetting, Build, Layer
import os
import traceback
import warnings
def DN(path):
if path is None:
@@ -21,39 +26,6 @@ class Command(NoArgsCommand):
super(Command, self).__init__(*args, **kwargs)
self.guesspath = DN(DN(DN(DN(DN(DN(DN(__file__)))))))
def _find_first_path_for_file(self, startdirectory, filename, level=0):
if level < 0:
return None
dirs = []
for i in os.listdir(startdirectory):
j = os.path.join(startdirectory, i)
if os.path.isfile(j):
if i == filename:
return startdirectory
elif os.path.isdir(j):
dirs.append(j)
for j in dirs:
ret = self._find_first_path_for_file(j, filename, level - 1)
if ret is not None:
return ret
return None
def _recursive_list_directories(self, startdirectory, level=0):
if level < 0:
return []
dirs = []
try:
for i in os.listdir(startdirectory):
j = os.path.join(startdirectory, i)
if os.path.isdir(j):
dirs.append(j)
except OSError:
pass
for j in dirs:
dirs = dirs + self._recursive_list_directories(j, level - 1)
return dirs
def _verify_build_environment(self):
# provide a local build env. This will be extended later to include non local
if BuildEnvironment.objects.count() == 0:
@@ -94,30 +66,58 @@ class Command(NoArgsCommand):
print("\n -- Validation: The build directory must to be set to an absolute path.")
is_changed = _update_builddir()
if is_changed:
print("\nBuild configuration saved")
be.save()
return True
if be.needs_import:
try:
config_file = os.environ.get('TOASTER_CONF')
print("\nImporting file: %s" % config_file)
from .loadconf import Command as LoadConfigCommand
print("Loading default settings")
call_command("loaddata", "settings")
template_conf = os.environ.get("TEMPLATECONF", "")
if "poky" in template_conf:
print("Loading poky configuration")
call_command("loaddata", "poky")
else:
print("Loading OE-Core configuration")
call_command("loaddata", "oe-core")
if template_conf:
oe_core_path = os.realpath(template_conf +
"/../")
else:
print("TEMPLATECONF not found. You may have to"
" manually configure layer paths")
oe_core_path = input("Please enter the path of"
" your openembedded-core "
"layer: ")
# Update the layer instances of openemebedded-core
for layer in Layer.objects.filter(
name="openembedded-core"):
layer.local_source_dir = oe_core_path
layer.save()
# Import the custom fixture if it's present
with warnings.catch_warnings():
warnings.filterwarnings(
action="ignore",
message="^.*No fixture named.*$")
print("Importing custom settings if present")
call_command("loaddata", "custom")
LoadConfigCommand()._import_layer_config(config_file)
# we run lsupdates after config update
print("\nLayer configuration imported. Updating information from the layer sources, please wait.\nYou can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates")
from django.core.management import call_command
print("\nFetching information from the layer index, "
"please wait.\nYou can re-update any time later "
"by running bitbake/lib/toaster/manage.py "
"lsupdates\n")
call_command("lsupdates")
# we don't look for any other config files
return is_changed
except Exception as e:
print("Failure while trying to import the toaster config file %s: %s" %\
(config_file, e))
print("Failure while trying to setup toaster: %s"
% e)
traceback.print_exc()
return is_changed

View File

@@ -1,183 +0,0 @@
from django.core.management.base import BaseCommand, CommandError
from orm.models import LayerSource, ToasterSetting, Branch, Layer, Layer_Version
from orm.models import BitbakeVersion, Release, ReleaseDefaultLayer, ReleaseLayerSourcePriority
from django.db import IntegrityError
import os
from .checksettings import DN
import logging
logger = logging.getLogger("toaster")
def _reduce_canon_path(path):
components = []
for c in path.split("/"):
if c == "..":
del components[-1]
elif c == ".":
pass
else:
components.append(c)
if len(components) < 2:
components.append('')
return "/".join(components)
def _get_id_for_sourcetype(s):
for i in LayerSource.SOURCE_TYPE:
if s == i[1]:
return i[0]
raise Exception("Could not find definition for sourcetype '%s'. Valid source types are %s" % (str(s), ', '.join(map(lambda x: "'%s'" % x[1], LayerSource.SOURCE_TYPE ))))
class Command(BaseCommand):
help = "Loads a toasterconf.json file in the database"
args = "filepath"
def _import_layer_config(self, filepath):
if not os.path.exists(filepath) or not os.path.isfile(filepath):
raise Exception("Failed to find toaster config file %s ." % filepath)
import json
data = json.loads(open(filepath, "r").read())
# verify config file validity before updating settings
for i in ['bitbake', 'releases', 'defaultrelease', 'config', 'layersources']:
assert i in data
def _read_git_url_from_local_repository(address):
url = None
# we detect the remote name at runtime
import subprocess
(remote, remote_name) = address.split(":", 1)
cmd = subprocess.Popen("git remote -v", shell=True, cwd = os.path.dirname(filepath), stdout=subprocess.PIPE, stderr = subprocess.PIPE)
(out,err) = cmd.communicate()
if cmd.returncode != 0:
logging.warning("Error while importing layer vcs_url: git error: %s" % err)
for line in out.decode('utf-8').split("\n"):
try:
(name, path) = line.split("\t", 1)
if name == remote_name:
url = path.split(" ")[0]
break
except ValueError:
pass
if url == None:
logging.warning("Error while looking for remote \"%s\" in \"%s\"" % (remote_name, out))
return url
# import bitbake data
for bvi in data['bitbake']:
bvo, created = BitbakeVersion.objects.get_or_create(name=bvi['name'])
if bvi['giturl'].startswith("remote:"):
bvo.giturl = _read_git_url_from_local_repository(bvi['giturl'])
if bvo.giturl is None:
logger.error("The toaster config file references the local git repo, but Toaster cannot detect it.\nYour local configuration for bitbake version %s is invalid. Make sure that the toasterconf.json file is correct." % bvi['name'])
if bvo.giturl is None:
bvo.giturl = bvi['giturl']
bvo.branch = bvi['branch']
bvo.dirpath = bvi['dirpath']
bvo.save()
# set the layer sources
for lsi in data['layersources']:
assert 'sourcetype' in lsi
assert 'apiurl' in lsi
assert 'name' in lsi
assert 'branches' in lsi
if _get_id_for_sourcetype(lsi['sourcetype']) == LayerSource.TYPE_LAYERINDEX or lsi['apiurl'].startswith("/"):
apiurl = lsi['apiurl']
else:
apiurl = _reduce_canon_path(os.path.join(DN(os.path.abspath(filepath)), lsi['apiurl']))
assert ((_get_id_for_sourcetype(lsi['sourcetype']) == LayerSource.TYPE_LAYERINDEX) or apiurl.startswith("/")), (lsi['sourcetype'],apiurl)
try:
ls, created = LayerSource.objects.get_or_create(sourcetype = _get_id_for_sourcetype(lsi['sourcetype']), apiurl = apiurl)
ls.name = lsi['name']
ls.save()
except IntegrityError as e:
logger.warning("IntegrityError %s \nWhile setting name %s for layer source %s " % (e, lsi['name'], ls))
layerbranches = []
for branchname in lsi['branches']:
bo, created = Branch.objects.get_or_create(layer_source = ls, name = branchname)
layerbranches.append(bo)
if 'layers' in lsi:
for layerinfo in lsi['layers']:
lo, created = Layer.objects.get_or_create(layer_source = ls, name = layerinfo['name'])
if layerinfo['local_path'].startswith("/"):
lo.local_path = layerinfo['local_path']
else:
lo.local_path = _reduce_canon_path(os.path.join(ls.apiurl, layerinfo['local_path']))
if not os.path.exists(lo.local_path):
logger.error("Local layer path %s must exists. Are you trying to import a layer that does not exist ? Check your local toasterconf.json" % lo.local_path)
if layerinfo['vcs_url'].startswith("remote:"):
lo.vcs_url = _read_git_url_from_local_repository(layerinfo['vcs_url'])
if lo.vcs_url is None:
logger.error("The toaster config file references the local git repo, but Toaster cannot detect it.\nYour local configuration for layer %s is invalid. Make sure that the toasterconf.json file is correct." % layerinfo['name'])
if lo.vcs_url is None:
lo.vcs_url = layerinfo['vcs_url']
if 'layer_index_url' in layerinfo:
lo.layer_index_url = layerinfo['layer_index_url']
lo.save()
for branch in layerbranches:
lvo, created = Layer_Version.objects.get_or_create(layer_source = ls,
up_branch = branch,
commit = branch.name,
layer = lo)
lvo.dirpath = layerinfo['dirpath']
lvo.save()
# set releases
for ri in data['releases']:
bvo = BitbakeVersion.objects.get(name = ri['bitbake'])
assert bvo is not None
ro, created = Release.objects.get_or_create(name = ri['name'], bitbake_version = bvo, branch_name = ri['branch'])
ro.description = ri['description']
ro.helptext = ri['helptext']
ro.save()
# save layer source priority for release
for ls_name in ri['layersourcepriority'].keys():
rlspo, created = ReleaseLayerSourcePriority.objects.get_or_create(release = ro, layer_source = LayerSource.objects.get(name=ls_name))
rlspo.priority = ri['layersourcepriority'][ls_name]
rlspo.save()
for dli in ri['defaultlayers']:
# find layers with the same name
ReleaseDefaultLayer.objects.get_or_create( release = ro, layer_name = dli)
# set default release
if ToasterSetting.objects.filter(name = "DEFAULT_RELEASE").count() > 0:
ToasterSetting.objects.filter(name = "DEFAULT_RELEASE").update(value = data['defaultrelease'])
else:
ToasterSetting.objects.create(name = "DEFAULT_RELEASE", value = data['defaultrelease'])
# set default config variables
for configname in data['config']:
if ToasterSetting.objects.filter(name = "DEFCONF_" + configname).count() > 0:
ToasterSetting.objects.filter(name = "DEFCONF_" + configname).update(value = data['config'][configname])
else:
ToasterSetting.objects.create(name = "DEFCONF_" + configname, value = data['config'][configname])
def handle(self, *args, **options):
if len(args) == 0:
raise CommandError("Need a path to the toasterconf.json file")
filepath = args[0]
self._import_layer_config(filepath)

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bldcontrol', '0004_auto_20160523_1446'),
]
operations = [
migrations.AlterField(
model_name='buildrequest',
name='state',
field=models.IntegerField(choices=[(0, 'created'), (1, 'queued'), (2, 'in progress'), (3, 'failed'), (4, 'deleted'), (5, 'cancelling'), (6, 'completed'), (7, 'archive')], default=0),
),
]

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bldcontrol', '0005_reorder_buildrequest_states'),
]
operations = [
migrations.AddField(
model_name='brlayer',
name='local_source_dir',
field=models.CharField(max_length=254, null=True),
),
]

View File

@@ -63,20 +63,20 @@ class BuildRequest(models.Model):
REQ_CREATED = 0
REQ_QUEUED = 1
REQ_INPROGRESS = 2
REQ_COMPLETED = 3
REQ_FAILED = 4
REQ_DELETED = 5
REQ_CANCELLING = 6
REQ_FAILED = 3
REQ_DELETED = 4
REQ_CANCELLING = 5
REQ_COMPLETED = 6
REQ_ARCHIVE = 7
REQUEST_STATE = (
(REQ_CREATED, "created"),
(REQ_QUEUED, "queued"),
(REQ_INPROGRESS, "in progress"),
(REQ_COMPLETED, "completed"),
(REQ_FAILED, "failed"),
(REQ_DELETED, "deleted"),
(REQ_CANCELLING, "cancelling"),
(REQ_COMPLETED, "completed"),
(REQ_ARCHIVE, "archive"),
)
@@ -91,7 +91,7 @@ class BuildRequest(models.Model):
def __init__(self, *args, **kwargs):
super(BuildRequest, self).__init__(*args, **kwargs)
# Save the old state incase it's about to be modified
# Save the old state in case it's about to be modified
self.old_state = self.state
def save(self, *args, **kwargs):
@@ -130,6 +130,7 @@ class BRLayer(models.Model):
req = models.ForeignKey(BuildRequest)
name = models.CharField(max_length = 100)
giturl = models.CharField(max_length = 254)
local_source_dir = models.CharField(max_length=254, null=True)
commit = models.CharField(max_length = 254)
dirpath = models.CharField(max_length = 254)
layer_version = models.ForeignKey(Layer_Version, null=True)

View File

@@ -139,22 +139,3 @@ class RunBuildsCommandTests(TestCase):
self.assertTrue(br.state == BuildRequest.REQ_INPROGRESS, "Request is not updated")
# no more selections possible here
self.assertRaises(IndexError, command._selectBuildRequest)
class UtilityTests(TestCase):
def test_reduce_path(self):
from bldcontrol.management.commands.loadconf import _reduce_canon_path, _get_id_for_sourcetype
self.assertTrue( _reduce_canon_path("/") == "/")
self.assertTrue( _reduce_canon_path("/home/..") == "/")
self.assertTrue( _reduce_canon_path("/home/../ana") == "/ana")
self.assertTrue( _reduce_canon_path("/home/../ana/..") == "/")
self.assertTrue( _reduce_canon_path("/home/ana/mihai/../maria") == "/home/ana/maria")
def test_get_id_for_sorucetype(self):
from bldcontrol.management.commands.loadconf import _reduce_canon_path, _get_id_for_sourcetype
self.assertTrue( _get_id_for_sourcetype("layerindex") == 1)
self.assertTrue( _get_id_for_sourcetype("local") == 0)
self.assertTrue( _get_id_for_sourcetype("imported") == 2)
with self.assertRaises(Exception):
_get_id_for_sourcetype("unknown")

View File

@@ -0,0 +1,30 @@
# Fixtures directory
Fixtures are data dumps that can be loaded into Toaster's database to provide
configuration and data.
In this directory we have the fixtures which are loaded the first time you start Toaster.
This is to provide useful default values and metadata to Toaster.
- settings.xml This Contains Toaster wide settings, such as the default values for
certain bitbake variables.
- poky.xml This is the default release data for supported poky based setup
- oe-core.xml This is the default release data for supported oe-core based setups
# Custom data/configuration
- custom.xml
To add custom initial data/configuration to Toaster place a file called
"custom.xml" in this directory. If present it will be loaded into the database.
We suggest that this is used to overlay any configuration already done.
All objects loaded with the same primary keys overwrite the existing data.
Data can be provided in XML, JSON and if installed YAML formats.
# To load data at any point in time
Use the django management command manage.py loaddata <your fixture file>
For further information see the Django command documentation at:
https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-loaddata

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<django-objects version="1.0">
<!-- Bitbake versions which correspond to the metadata release -->
<object model="orm.bitbakeversion" pk="1">
<field type="CharField" name="name">master</field>
<field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
<field type="CharField" name="branch">master</field>
<field type="CharField" name="dirpath">bitbake</field>
</object>
<object model="orm.bitbakeversion" pk="2">
<field type="CharField" name="name">HEAD</field>
<field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field>
<field type="CharField" name="branch">HEAD</field>
<field type="CharField" name="dirpath">bitbake</field>
</object>
<!-- Releases available -->
<object model="orm.release" pk="1">
<field type="CharField" name="name">master</field>
<field type="CharField" name="description">Openembedded master</field>
<field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">1</field>
<field type="CharField" name="branch_name">master</field>
<field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href=\"http://cgit.openembedded.org/openembedded-core/log/\"&gt;OpenEmbedded master&lt;/a&gt; branch, where active development takes place. This is not a stable branch, so your builds might not work as expected.</field>
</object>
<object model="orm.release" pk="2">
<field type="CharField" name="name">local</field>
<field type="CharField" name="description">Local Openembedded</field>
<field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">2</field>
<field type="CharField" name="branch_name">HEAD</field>
<field type="TextField" name="helptext">Toaster will run your builds with the version of OpenEmbedded that you have cloned or downloaded to your computer.</field>
</object>
<!-- Default layers for each release -->
<object model="orm.releasedefaultlayer" pk="1">
<field rel="ManyToOneRel" to="orm.release" name="release">1</field>
<field type="CharField" name="layer_name">openembedded-core</field>
</object>
<object model="orm.releasedefaultlayer" pk="4">
<field rel="ManyToOneRel" to="orm.release" name="release">2</field>
<field type="CharField" name="layer_name">openembedded-core</field>
</object>
<!-- TYPE_LOCAL = 0 Layers for the Local release -->
<object model="orm.layer" pk="1">
<field type="CharField" name="name">openembedded-core</field>
<field type="CharField" name="layer_index_url"></field>
<field type="CharField" name="vcs_url">git://git.openembedded.org/openembedded-core</field>
</object>
<object model="orm.layer_version" pk="1">
<field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
<field type="IntegerField" name="layer_source">0</field>
<field rel="ManyToOneRel" to="orm.release" name="release">2</field>
<field type="CharField" name="branch">HEAD</field>
<field type="CharField" name="commit">HEAD</field>
</object>
</django-objects>

View File

@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<django-objects version="1.0">
<!-- Bitbake versions which correspond to the metadata release -->
<object model="orm.bitbakeversion" pk="1">
<field type="CharField" name="name">master</field>
<field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
<field type="CharField" name="branch">master</field>
<field type="CharField" name="dirpath">bitbake</field>
</object>
<object model="orm.bitbakeversion" pk="2">
<field type="CharField" name="name">HEAD</field>
<field type="CharField" name="giturl">git://git.yoctoproject.org/poky</field>
<field type="CharField" name="branch">HEAD</field>
<field type="CharField" name="dirpath">bitbake</field>
</object>
<!-- Releases available -->
<object model="orm.release" pk="1">
<field type="CharField" name="name">master</field>
<field type="CharField" name="description">Yocto Project master</field>
<field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">1</field>
<field type="CharField" name="branch_name">master</field>
<field type="TextField" name="helptext">Toaster will run your builds using the tip of the &lt;a href="http://git.yoctoproject.org/cgit/cgit.cgi/poky/log/"&gt;Yocto Project master branch&lt;/a&gt;, where active development takes place. This is not a stable branch, so your builds might not work as expected.</field>
</object>
<object model="orm.release" pk="2">
<field type="CharField" name="name">local</field>
<field type="CharField" name="description">Local Yocto Project</field>
<field rel="ManyToOneRel" to="orm.bitbakeversion" name="bitbake_version">2</field>
<field type="CharField" name="branch_name">HEAD</field>
<field type="TextField" name="helptext">Toaster will run your builds with the version of the Yocto Project you have cloned or downloaded to your computer.</field>
</object>
<!-- Default layers for each release -->
<object model="orm.releasedefaultlayer" pk="1">
<field rel="ManyToOneRel" to="orm.release" name="release">1</field>
<field type="CharField" name="layer_name">openembedded-core</field>
</object>
<object model="orm.releasedefaultlayer" pk="2">
<field rel="ManyToOneRel" to="orm.release" name="release">1</field>
<field type="CharField" name="layer_name">meta-poky</field>
</object>
<object model="orm.releasedefaultlayer" pk="3">
<field rel="ManyToOneRel" to="orm.release" name="release">1</field>
<field type="CharField" name="layer_name">meta-yocto-bsp</field>
</object>
<object model="orm.releasedefaultlayer" pk="4">
<field rel="ManyToOneRel" to="orm.release" name="release">2</field>
<field type="CharField" name="layer_name">openembedded-core</field>
</object>
<object model="orm.releasedefaultlayer" pk="5">
<field rel="ManyToOneRel" to="orm.release" name="release">2</field>
<field type="CharField" name="layer_name">meta-poky</field>
</object>
<object model="orm.releasedefaultlayer" pk="6">
<field rel="ManyToOneRel" to="orm.release" name="release">2</field>
<field type="CharField" name="layer_name">meta-yocto-bsp</field>
</object>
<!-- Layers for the Local release
layersource TYPE_LOCAL = 0
-->
<object model="orm.layer" pk="1">
<field type="CharField" name="name">openembedded-core</field>
<field type="CharField" name="layer_index_url"></field>
<field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
</object>
<object model="orm.layer_version" pk="1">
<field rel="ManyToOneRel" to="orm.layer" name="layer">1</field>
<field type="IntegerField" name="layer_source">0</field>
<field rel="ManyToOneRel" to="orm.release" name="release">2</field>
<field type="CharField" name="branch">HEAD</field>
<field type="CharField" name="commit">HEAD</field>
<field type="CharField" name="dirpath">meta</field>
</object>
<object model="orm.layer" pk="2">
<field type="CharField" name="name">meta-poky</field>
<field type="CharField" name="layer_index_url"></field>
<field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
</object>
<object model="orm.layer_version" pk="2">
<field rel="ManyToOneRel" to="orm.layer" name="layer">2</field>
<field type="IntegerField" name="layer_source">0</field>
<field rel="ManyToOneRel" to="orm.release" name="release">2</field>
<field type="CharField" name="branch">HEAD</field>
<field type="CharField" name="commit">HEAD</field>
<field type="CharField" name="dirpath">meta-poky</field>
</object>
<object model="orm.layer" pk="3">
<field type="CharField" name="name">meta-yocto-bsp</field>
<field type="CharField" name="layer_index_url"></field>
<field type="CharField" name="vcs_url">git://git.yoctoproject.org/poky</field>
</object>
<object model="orm.layer_version" pk="3">
<field rel="ManyToOneRel" to="orm.layer" name="layer">3</field>
<field type="IntegerField" name="layer_source">0</field>
<field rel="ManyToOneRel" to="orm.release" name="release">2</field>
<field type="CharField" name="branch">HEAD</field>
<field type="CharField" name="commit">HEAD</field>
<field type="CharField" name="dirpath">meta-yocto-bsp</field>
</object>
</django-objects>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<django-objects version="1.0">
<!-- Default project settings -->
<object model="orm.toastersetting" pk="1">
<field type="CharField" name="name">DEFAULT_RELEASE</field>
<field type="CharField" name="value">master</field>
</object>
<object model="orm.toastersetting" pk="2">
<field type="CharField" name="name">DEFCONF_PACKAGE_CLASSES</field>
<field type="CharField" name="value">package_rpm</field>
</object>
<object model="orm.toastersetting" pk="3">
<field type="CharField" name="name">DEFCONF_MACHINE</field>
<field type="CharField" name="value">qemux86</field>
</object>
<object model="orm.toastersetting" pk="4">
<field type="CharField" name="name">DEFCONF_SSTATE_DIR</field>
<field type="CharField" name="value">${TOPDIR}/../sstate-cache</field>
</object>
<object model="orm.toastersetting" pk="5">
<field type="CharField" name="name">DEFCONF_IMAGE_INSTALL_append</field>
<field type="CharField" name="value"></field>
</object>
<object model="orm.toastersetting" pk="6">
<field type="CharField" name="name">DEFCONF_IMAGE_FSTYPES</field>
<field type="CharField" name="value">ext3 jffs2 tar.bz2</field>
</object>
<object model="orm.toastersetting" pk="7">
<field type="CharField" name="name">DEFCONF_DISTRO</field>
<field type="CharField" name="value">poky</field>
</object>
<object model="orm.toastersetting" pk="8">
<field type="CharField" name="name">DEFCONF_DL_DIR</field>
<field type="CharField" name="value">${TOPDIR}/../downloads</field>
</object>
</django-objects>

View File

@@ -1,12 +1,328 @@
from django.core.management.base import NoArgsCommand, CommandError
from orm.models import LayerSource
#
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.core.management.base import NoArgsCommand
from orm.models import LayerSource, Layer, Release, Layer_Version
from orm.models import LayerVersionDependency, Machine, Recipe
import os
import sys
import json
import logging
import threading
import time
logger = logging.getLogger("toaster")
DEFAULT_LAYERINDEX_SERVER = "http://layers.openembedded.org/layerindex/api/"
class Spinner(threading.Thread):
""" A simple progress spinner to indicate download/parsing is happening"""
def __init__(self, *args, **kwargs):
super(Spinner, self).__init__(*args, **kwargs)
self.setDaemon(True)
self.signal = True
def run(self):
os.system('setterm -cursor off')
while self.signal:
for char in ["/", "-", "\\", "|"]:
sys.stdout.write("\r" + char)
sys.stdout.flush()
time.sleep(0.25)
os.system('setterm -cursor on')
def stop(self):
self.signal = False
class Command(NoArgsCommand):
args = ""
help = "Updates locally cached information from all LayerSources"
args = ""
help = "Updates locally cached information from a layerindex server"
def mini_progress(self, what, i, total):
i = i + 1
pec = (float(i)/float(total))*100
sys.stdout.write("\rUpdating %s %d%%" %
(what,
pec))
sys.stdout.flush()
if int(pec) is 100:
sys.stdout.write("\n")
sys.stdout.flush()
def update(self):
"""
Fetches layer, recipe and machine information from a layerindex
server
"""
os.system('setterm -cursor off')
self.apiurl = DEFAULT_LAYERINDEX_SERVER
assert self.apiurl is not None
try:
from urllib.request import urlopen, URLError
from urllib.parse import urlparse
except ImportError:
from urllib2 import urlopen, URLError
from urlparse import urlparse
proxy_settings = os.environ.get("http_proxy", None)
oe_core_layer = 'openembedded-core'
def _get_json_response(apiurl=DEFAULT_LAYERINDEX_SERVER):
http_progress = Spinner()
http_progress.start()
_parsedurl = urlparse(apiurl)
path = _parsedurl.path
# logger.debug("Fetching %s", apiurl)
try:
res = urlopen(apiurl)
except URLError as e:
raise Exception("Failed to read %s: %s" % (path, e.reason))
parsed = json.loads(res.read().decode('utf-8'))
http_progress.stop()
return parsed
# verify we can get the basic api
try:
apilinks = _get_json_response()
except Exception as e:
import traceback
if proxy_settings is not None:
logger.info("EE: Using proxy %s" % proxy_settings)
logger.warning("EE: could not connect to %s, skipping update:"
"%s\n%s" % (self.apiurl, e, traceback.format_exc()))
return
# update branches; only those that we already have names listed in the
# Releases table
whitelist_branch_names = [rel.branch_name
for rel in Release.objects.all()]
if len(whitelist_branch_names) == 0:
raise Exception("Failed to make list of branches to fetch")
logger.info("Fetching metadata releases for %s",
" ".join(whitelist_branch_names))
branches_info = _get_json_response(apilinks['branches'] +
"?filter=name:%s"
% "OR".join(whitelist_branch_names))
# Map the layer index branches to toaster releases
li_branch_id_to_toaster_release = {}
total = len(branches_info)
for i, branch in enumerate(branches_info):
li_branch_id_to_toaster_release[branch['id']] = \
Release.objects.get(name=branch['name'])
self.mini_progress("Releases", i, total)
# keep a track of the layerindex (li) id mappings so that
# layer_versions can be created for these layers later on
li_layer_id_to_toaster_layer_id = {}
logger.info("Fetching layers")
layers_info = _get_json_response(apilinks['layerItems'])
total = len(layers_info)
for i, li in enumerate(layers_info):
# Special case for the openembedded-core layer
if li['name'] == oe_core_layer:
try:
# If we have an existing openembedded-core for example
# from the toasterconf.json augment the info using the
# layerindex rather than duplicate it
oe_core_l = Layer.objects.get(name=oe_core_layer)
# Take ownership of the layer as now coming from the
# layerindex
oe_core_l.summary = li['summary']
oe_core_l.description = li['description']
oe_core_l.save()
li_layer_id_to_toaster_layer_id[li['id']] = oe_core_l.pk
self.mini_progress("layers", i, total)
continue
except Layer.DoesNotExist:
pass
try:
l, created = Layer.objects.get_or_create(name=li['name'],
vcs_url=li['vcs_url'])
l.up_date = li['updated']
l.vcs_url = li['vcs_url']
l.vcs_web_url = li['vcs_web_url']
l.vcs_web_tree_base_url = li['vcs_web_tree_base_url']
l.vcs_web_file_base_url = li['vcs_web_file_base_url']
l.summary = li['summary']
l.description = li['description']
l.save()
except Layer.MultipleObjectsReturned:
logger.info("Skipped %s as we found multiple layers and "
"don't know which to update" %
li['name'])
li_layer_id_to_toaster_layer_id[li['id']] = l.pk
self.mini_progress("layers", i, total)
# update layer_versions
logger.info("Fetching layer versions")
layerbranches_info = _get_json_response(
apilinks['layerBranches'] + "?filter=branch__name:%s" %
"OR".join(whitelist_branch_names))
# Map Layer index layer_branch object id to
# layer_version toaster object id
li_layer_branch_id_to_toaster_lv_id = {}
total = len(layerbranches_info)
for i, lbi in enumerate(layerbranches_info):
try:
lv, created = Layer_Version.objects.get_or_create(
layer_source=LayerSource.TYPE_LAYERINDEX,
layer=Layer.objects.get(
pk=li_layer_id_to_toaster_layer_id[lbi['layer']])
)
except KeyError:
logger.warning(
"No such layerindex layer referenced by layerbranch %d" %
lbi['layer'])
continue
lv.release = li_branch_id_to_toaster_release[lbi['branch']]
lv.up_date = lbi['updated']
lv.commit = lbi['actual_branch']
lv.dirpath = lbi['vcs_subdir']
lv.save()
li_layer_branch_id_to_toaster_lv_id[lbi['id']] =\
lv.pk
self.mini_progress("layer versions", i, total)
logger.info("Fetching layer version dependencies")
# update layer dependencies
layerdependencies_info = _get_json_response(
apilinks['layerDependencies'] +
"?filter=layerbranch__branch__name:%s" %
"OR".join(whitelist_branch_names))
dependlist = {}
for ldi in layerdependencies_info:
try:
lv = Layer_Version.objects.get(
pk=li_layer_branch_id_to_toaster_lv_id[ldi['layerbranch']])
except Layer_Version.DoesNotExist as e:
continue
if lv not in dependlist:
dependlist[lv] = []
try:
layer_id = li_layer_id_to_toaster_layer_id[ldi['dependency']]
dependlist[lv].append(
Layer_Version.objects.get(
layer_source=LayerSource.TYPE_LAYERINDEX,
layer__pk=layer_id))
except Layer_Version.DoesNotExist:
logger.warning("Cannot find layer version (ls:%s),"
"up_id:%s lv:%s" %
(self, ldi['dependency'], lv))
total = len(dependlist)
for i, lv in enumerate(dependlist):
LayerVersionDependency.objects.filter(layer_version=lv).delete()
for lvd in dependlist[lv]:
LayerVersionDependency.objects.get_or_create(layer_version=lv,
depends_on=lvd)
self.mini_progress("Layer version dependencies", i, total)
# update machines
logger.info("Fetching machine information")
machines_info = _get_json_response(
apilinks['machines'] + "?filter=layerbranch__branch__name:%s" %
"OR".join(whitelist_branch_names))
total = len(machines_info)
for i, mi in enumerate(machines_info):
mo, created = Machine.objects.get_or_create(
name=mi['name'],
layer_version=Layer_Version.objects.get(
pk=li_layer_branch_id_to_toaster_lv_id[mi['layerbranch']]))
mo.up_date = mi['updated']
mo.name = mi['name']
mo.description = mi['description']
mo.save()
self.mini_progress("machines", i, total)
# update recipes; paginate by layer version / layer branch
logger.info("Fetching recipe information")
recipes_info = _get_json_response(
apilinks['recipes'] + "?filter=layerbranch__branch__name:%s" %
"OR".join(whitelist_branch_names))
total = len(recipes_info)
for i, ri in enumerate(recipes_info):
try:
lv_id = li_layer_branch_id_to_toaster_lv_id[ri['layerbranch']]
lv = Layer_Version.objects.get(pk=lv_id)
ro, created = Recipe.objects.get_or_create(
layer_version=lv,
name=ri['pn']
)
ro.layer_version = lv
ro.up_date = ri['updated']
ro.name = ri['pn']
ro.version = ri['pv']
ro.summary = ri['summary']
ro.description = ri['description']
ro.section = ri['section']
ro.license = ri['license']
ro.homepage = ri['homepage']
ro.bugtracker = ri['bugtracker']
ro.file_path = ri['filepath'] + "/" + ri['filename']
if 'inherits' in ri:
ro.is_image = 'image' in ri['inherits'].split()
else: # workaround for old style layer index
ro.is_image = "-image-" in ri['pn']
ro.save()
except Exception as e:
logger.warning("Failed saving recipe %s", e)
self.mini_progress("recipes", i, total)
os.system('setterm -cursor on')
def handle_noargs(self, **options):
for ls in LayerSource.objects.all():
ls.update()
self.update()

View File

@@ -0,0 +1,118 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('orm', '0009_target_package_manifest_path'),
]
operations = [
migrations.AlterUniqueTogether(
name='releaselayersourcepriority',
unique_together=set([]),
),
migrations.RemoveField(
model_name='releaselayersourcepriority',
name='layer_source',
),
migrations.RemoveField(
model_name='releaselayersourcepriority',
name='release',
),
migrations.DeleteModel(
name='ImportedLayerSource',
),
migrations.DeleteModel(
name='LayerIndexLayerSource',
),
migrations.DeleteModel(
name='LocalLayerSource',
),
migrations.RemoveField(
model_name='recipe',
name='layer_source',
),
migrations.RemoveField(
model_name='recipe',
name='up_id',
),
migrations.AlterField(
model_name='layer',
name='up_date',
field=models.DateTimeField(default=django.utils.timezone.now, null=True),
),
migrations.AlterField(
model_name='layer_version',
name='layer_source',
field=models.IntegerField(default=0, choices=[(0, 'local'), (1, 'layerindex'), (2, 'imported'), (3, 'build')]),
),
migrations.AlterField(
model_name='layer_version',
name='up_date',
field=models.DateTimeField(default=django.utils.timezone.now, null=True),
),
migrations.AlterUniqueTogether(
name='branch',
unique_together=set([]),
),
migrations.AlterUniqueTogether(
name='layer',
unique_together=set([]),
),
migrations.AlterUniqueTogether(
name='layer_version',
unique_together=set([]),
),
migrations.AlterUniqueTogether(
name='layerversiondependency',
unique_together=set([]),
),
migrations.AlterUniqueTogether(
name='machine',
unique_together=set([]),
),
migrations.DeleteModel(
name='ReleaseLayerSourcePriority',
),
migrations.RemoveField(
model_name='branch',
name='layer_source',
),
migrations.RemoveField(
model_name='branch',
name='up_id',
),
migrations.RemoveField(
model_name='layer',
name='layer_source',
),
migrations.RemoveField(
model_name='layer',
name='up_id',
),
migrations.RemoveField(
model_name='layer_version',
name='up_id',
),
migrations.RemoveField(
model_name='layerversiondependency',
name='layer_source',
),
migrations.RemoveField(
model_name='layerversiondependency',
name='up_id',
),
migrations.RemoveField(
model_name='machine',
name='layer_source',
),
migrations.RemoveField(
model_name='machine',
name='up_id',
),
]

View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orm', '0010_delete_layer_source_references'),
]
operations = [
migrations.DeleteModel(
name='LayerSource',
),
]

View File

@@ -0,0 +1,62 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.db.models import Q
def branch_to_release(apps, schema_editor):
Layer_Version = apps.get_model('orm', 'Layer_Version')
Release = apps.get_model('orm', 'Release')
print("Converting all layer version up_branches to releases")
# Find all the layer versions which have an upbranch and convert them to
# the release that they're for.
for layer_version in Layer_Version.objects.filter(
Q(release=None) & ~Q(up_branch=None)):
try:
# HEAD and local are equivalent
if "HEAD" in layer_version.up_branch.name:
release = Release.objects.get(name="local")
layer_version.commit = "HEAD"
layer_version.branch = "HEAD"
else:
release = Release.objects.get(
name=layer_version.up_branch.name)
layer_version.release = release
layer_version.save()
except Exception as e:
print("Couldn't work out an appropriate release for %s "
"the up_branch was %s "
"user the django admin interface to correct it" %
(layer_version.layer.name, layer_version.up_branch.name))
print(e)
continue
class Migration(migrations.Migration):
dependencies = [
('orm', '0011_delete_layersource'),
]
operations = [
migrations.AddField(
model_name='layer_version',
name='release',
field=models.ForeignKey(to='orm.Release', default=None, null=True),
),
migrations.RunPython(branch_to_release,
reverse_code=migrations.RunPython.noop),
migrations.RemoveField(
model_name='layer_version',
name='up_branch',
),
migrations.DeleteModel(
name='Branch',
),
]

View File

@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orm', '0012_use_release_instead_of_up_branch'),
]
operations = [
migrations.AddField(
model_name='build',
name='recipes_parsed',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='build',
name='recipes_to_parse',
field=models.IntegerField(default=1),
),
]

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orm', '0013_recipe_parse_progress_fields'),
]
operations = [
migrations.AlterField(
model_name='build',
name='build_name',
field=models.CharField(default='', max_length=100),
),
]

View File

@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orm', '0014_allow_empty_buildname'),
]
operations = [
migrations.AddField(
model_name='layer',
name='local_source_dir',
field=models.TextField(null=True, default=None),
),
]

View File

@@ -21,8 +21,8 @@
from __future__ import unicode_literals
from django.db import models, IntegrityError
from django.db.models import F, Q, Avg, Max, Sum, Count
from django.db import models, IntegrityError, DataError
from django.db.models import F, Q, Sum, Count
from django.utils import timezone
from django.utils.encoding import force_bytes
@@ -78,7 +78,7 @@ if 'sqlite' in settings.DATABASES['default']['ENGINE']:
try:
obj = self.create(**params)
return obj, True
except IntegrityError:
except (IntegrityError, DataError):
exc_info = sys.exc_info()
try:
return self.get(**lookup), False
@@ -117,39 +117,48 @@ class ToasterSetting(models.Model):
def __unicode__(self):
return "Setting %s = %s" % (self.name, self.value)
class ProjectManager(models.Manager):
def create_project(self, name, release):
if release is not None:
prj = self.model(name = name, bitbake_version = release.bitbake_version, release = release)
prj = self.model(name=name,
bitbake_version=release.bitbake_version,
release=release)
else:
prj = self.model(name = name, bitbake_version = None, release = None)
prj = self.model(name=name,
bitbake_version=None,
release=None)
prj.save()
for defaultconf in ToasterSetting.objects.filter(name__startswith="DEFCONF_"):
for defaultconf in ToasterSetting.objects.filter(
name__startswith="DEFCONF_"):
name = defaultconf.name[8:]
ProjectVariable.objects.create( project = prj,
name = name,
value = defaultconf.value)
ProjectVariable.objects.create(project=prj,
name=name,
value=defaultconf.value)
if release is None:
return prj
for rdl in release.releasedefaultlayer_set.all():
try:
lv = Layer_Version.objects.filter(layer__name = rdl.layer_name, up_branch__name = release.branch_name)[0].get_equivalents_wpriority(prj)[0]
ProjectLayer.objects.create( project = prj,
layercommit = lv,
optional = False )
except IndexError:
# we may have no valid layer version objects, and that's ok
pass
lv = Layer_Version.objects.filter(
layer__name=rdl.layer_name,
release=release).first()
if lv:
ProjectLayer.objects.create(project=prj,
layercommit=lv,
optional=False)
else:
logger.warning("Default project layer %s not found" %
rdl.layer_name)
return prj
# return single object with is_default = True
def get_or_create_default_project(self):
projects = super(ProjectManager, self).filter(is_default = True)
projects = super(ProjectManager, self).filter(is_default=True)
if len(projects) > 1:
raise Exception('Inconsistent project data: multiple ' +
@@ -157,7 +166,8 @@ class ProjectManager(models.Manager):
elif len(projects) < 1:
options = {
'name': 'Command line builds',
'short_description': 'Project for builds started outside Toaster',
'short_description':
'Project for builds started outside Toaster',
'is_default': True
}
project = Project.objects.create(**options)
@@ -270,7 +280,7 @@ class Project(models.Model):
# guard on release, as it can be null
if self.release:
queryset = Layer_Version.objects.filter(
(Q(up_branch__name=self.release.branch_name) &
(Q(release=self.release) &
Q(build=None) &
Q(project=None)) |
Q(project=self))
@@ -336,7 +346,15 @@ class Project(models.Model):
for l in self.projectlayer_set.all().order_by("pk"):
commit = l.layercommit.get_vcs_reference()
print("ii Building layer ", l.layercommit.layer.name, " at vcs point ", commit)
BRLayer.objects.create(req = br, name = l.layercommit.layer.name, giturl = l.layercommit.layer.vcs_url, commit = commit, dirpath = l.layercommit.dirpath, layer_version=l.layercommit)
BRLayer.objects.create(
req=br,
name=l.layercommit.layer.name,
giturl=l.layercommit.layer.vcs_url,
commit=commit,
dirpath=l.layercommit.dirpath,
layer_version=l.layercommit,
local_source_dir=l.layercommit.layer.local_source_dir
)
br.state = BuildRequest.REQ_QUEUED
now = timezone.now()
@@ -387,9 +405,15 @@ class Build(models.Model):
completed_on = models.DateTimeField()
outcome = models.IntegerField(choices=BUILD_OUTCOME, default=IN_PROGRESS)
cooker_log_path = models.CharField(max_length=500)
build_name = models.CharField(max_length=100)
build_name = models.CharField(max_length=100, default='')
bitbake_version = models.CharField(max_length=50)
# number of recipes to parse for this build
recipes_to_parse = models.IntegerField(default=1)
# number of recipes parsed so far for this build
recipes_parsed = models.IntegerField(default=0)
@staticmethod
def get_recent(project=None):
"""
@@ -420,6 +444,21 @@ class Build(models.Model):
return recent_builds
def started(self):
"""
As build variables are only added for a build when its BuildStarted event
is received, a build with no build variables is counted as
"in preparation" and not properly started yet. This method
will return False if a build has no build variables (it never properly
started), or True otherwise.
Note that this is a temporary workaround for the fact that we don't
have a fine-grained state variable on a build which would allow us
to record "in progress" (BuildStarted received) vs. "in preparation".
"""
variables = Variable.objects.filter(build=self)
return len(variables) > 0
def completeper(self):
tf = Task.objects.filter(build = self)
tfc = tf.count()
@@ -582,22 +621,64 @@ class Build(models.Model):
return target_labels
def get_current_status(self):
"""
get the status string from the build request if the build
has one, or the text for the build outcome if it doesn't
"""
from bldcontrol.models import BuildRequest
build_request = None
def get_buildrequest(self):
buildrequest = None
if hasattr(self, 'buildrequest'):
build_request = self.buildrequest
buildrequest = self.buildrequest
return buildrequest
if (build_request
and build_request.state != BuildRequest.REQ_INPROGRESS
and self.outcome == Build.IN_PROGRESS):
return self.buildrequest.get_state_display()
def is_queued(self):
from bldcontrol.models import BuildRequest
buildrequest = self.get_buildrequest()
if buildrequest:
return buildrequest.state == BuildRequest.REQ_QUEUED
else:
return False
def is_cancelling(self):
from bldcontrol.models import BuildRequest
buildrequest = self.get_buildrequest()
if buildrequest:
return self.outcome == Build.IN_PROGRESS and \
buildrequest.state == BuildRequest.REQ_CANCELLING
else:
return False
def is_parsing(self):
"""
True if the build is still parsing recipes
"""
return self.outcome == Build.IN_PROGRESS and \
self.recipes_parsed < self.recipes_to_parse
def is_starting(self):
"""
True if the build has no completed tasks yet and is still just starting
tasks.
Note that the mechanism for testing whether a Task is "done" is whether
its order field is set, as per the completeper() method.
"""
return self.outcome == Build.IN_PROGRESS and \
self.task_build.filter(order__isnull=False).count() == 0
def get_state(self):
"""
Get the state of the build; one of 'Succeeded', 'Failed', 'In Progress',
'Cancelled' (Build outcomes); or 'Queued', 'Cancelling' (states
dependent on the BuildRequest state).
This works around the fact that we have BuildRequest states as well
as Build states, but really we just want to know the state of the build.
"""
if self.is_cancelling():
return 'Cancelling';
elif self.is_queued():
return 'Queued'
elif self.is_parsing():
return 'Parsing'
elif self.is_starting():
return 'Starting'
else:
return self.get_outcome_text()
@@ -1126,21 +1207,27 @@ class Target_Installed_Package(models.Model):
target = models.ForeignKey(Target)
package = models.ForeignKey(Package, related_name='buildtargetlist_package')
class Package_File(models.Model):
package = models.ForeignKey(Package, related_name='buildfilelist_package')
path = models.FilePathField(max_length=255, blank=True)
size = models.IntegerField()
class Recipe(models.Model):
search_allowed_fields = ['name', 'version', 'file_path', 'section', 'summary', 'description', 'license', 'layer_version__layer__name', 'layer_version__branch', 'layer_version__commit', 'layer_version__local_path', 'layer_version__layer_source__name']
search_allowed_fields = ['name', 'version', 'file_path', 'section',
'summary', 'description', 'license',
'layer_version__layer__name',
'layer_version__branch', 'layer_version__commit',
'layer_version__local_path',
'layer_version__layer_source']
layer_source = models.ForeignKey('LayerSource', default = None, null = True) # from where did we get this recipe
up_id = models.IntegerField(null = True, default = None) # id of entry in the source
up_date = models.DateTimeField(null = True, default = None)
up_date = models.DateTimeField(null=True, default=None)
name = models.CharField(max_length=100, blank=True) # pn
version = models.CharField(max_length=100, blank=True) # pv
layer_version = models.ForeignKey('Layer_Version', related_name='recipe_layer_version')
name = models.CharField(max_length=100, blank=True)
version = models.CharField(max_length=100, blank=True)
layer_version = models.ForeignKey('Layer_Version',
related_name='recipe_layer_version')
summary = models.TextField(blank=True)
description = models.TextField(blank=True)
section = models.CharField(max_length=100, blank=True)
@@ -1151,13 +1238,6 @@ class Recipe(models.Model):
pathflags = models.CharField(max_length=200, blank=True)
is_image = models.BooleanField(default=False)
def get_layersource_view_url(self):
if self.layer_source is None:
return ""
url = self.layer_source.get_object_view(self.layer_version.up_branch, "recipes", self.name)
return url
def __unicode__(self):
return "Recipe " + self.name + ":" + self.version
@@ -1203,8 +1283,6 @@ class Recipe_Dependency(models.Model):
class Machine(models.Model):
search_allowed_fields = ["name", "description", "layer_version__layer__name"]
layer_source = models.ForeignKey('LayerSource', default = None, null = True) # from where did we get this machine
up_id = models.IntegerField(null = True, default = None) # id of entry in the source
up_date = models.DateTimeField(null = True, default = None)
layer_version = models.ForeignKey('Layer_Version')
@@ -1219,293 +1297,9 @@ class Machine(models.Model):
def __unicode__(self):
return "Machine " + self.name + "(" + self.description + ")"
class Meta:
unique_together = ("layer_source", "up_id")
from django.db.models.base import ModelBase
class InheritanceMetaclass(ModelBase):
def __call__(cls, *args, **kwargs):
obj = super(InheritanceMetaclass, cls).__call__(*args, **kwargs)
return obj.get_object()
class LayerSource(models.Model):
__metaclass__ = InheritanceMetaclass
class Meta:
unique_together = (('sourcetype', 'apiurl'), )
TYPE_LOCAL = 0
TYPE_LAYERINDEX = 1
TYPE_IMPORTED = 2
SOURCE_TYPE = (
(TYPE_LOCAL, "local"),
(TYPE_LAYERINDEX, "layerindex"),
(TYPE_IMPORTED, "imported"),
)
name = models.CharField(max_length=63, unique = True)
sourcetype = models.IntegerField(choices=SOURCE_TYPE)
apiurl = models.CharField(max_length=255, null=True, default=None)
def __init__(self, *args, **kwargs):
super(LayerSource, self).__init__(*args, **kwargs)
if self.sourcetype == LayerSource.TYPE_LOCAL:
self.__class__ = LocalLayerSource
elif self.sourcetype == LayerSource.TYPE_LAYERINDEX:
self.__class__ = LayerIndexLayerSource
elif self.sourcetype == LayerSource.TYPE_IMPORTED:
self.__class__ = ImportedLayerSource
elif self.sourcetype == None:
raise Exception("Unknown LayerSource-derived class. If you added a new layer source type, fill out all code stubs.")
def update(self):
"""
Updates the local database information from the upstream layer source
"""
raise Exception("Abstract, update() must be implemented by all LayerSource-derived classes (object is %s)" % str(vars(self)))
def save(self, *args, **kwargs):
return super(LayerSource, self).save(*args, **kwargs)
def get_object(self):
# preset an un-initilized object
if None == self.name:
self.name=""
if None == self.apiurl:
self.apiurl=""
if None == self.sourcetype:
self.sourcetype=LayerSource.TYPE_LOCAL
if self.sourcetype == LayerSource.TYPE_LOCAL:
self.__class__ = LocalLayerSource
elif self.sourcetype == LayerSource.TYPE_LAYERINDEX:
self.__class__ = LayerIndexLayerSource
elif self.sourcetype == LayerSource.TYPE_IMPORTED:
self.__class__ = ImportedLayerSource
else:
raise Exception("Unknown LayerSource type. If you added a new layer source type, fill out all code stubs.")
return self
def __unicode__(self):
return "%s (%s)" % (self.name, self.sourcetype)
class LocalLayerSource(LayerSource):
class Meta(LayerSource._meta.__class__):
proxy = True
def __init__(self, *args, **kwargs):
super(LocalLayerSource, self).__init__(args, kwargs)
self.sourcetype = LayerSource.TYPE_LOCAL
def update(self):
"""
Fetches layer, recipe and machine information from local repository
"""
pass
class ImportedLayerSource(LayerSource):
class Meta(LayerSource._meta.__class__):
proxy = True
def __init__(self, *args, **kwargs):
super(ImportedLayerSource, self).__init__(args, kwargs)
self.sourcetype = LayerSource.TYPE_IMPORTED
def update(self):
"""
Fetches layer, recipe and machine information from local repository
"""
pass
class LayerIndexLayerSource(LayerSource):
class Meta(LayerSource._meta.__class__):
proxy = True
def __init__(self, *args, **kwargs):
super(LayerIndexLayerSource, self).__init__(args, kwargs)
self.sourcetype = LayerSource.TYPE_LAYERINDEX
def get_object_view(self, branch, objectype, upid):
return self.apiurl + "../branch/" + branch.name + "/" + objectype + "/?q=" + str(upid)
def update(self):
"""
Fetches layer, recipe and machine information from remote repository
"""
assert self.apiurl is not None
from django.db import transaction, connection
import json
import os
try:
from urllib.request import urlopen, URLError
from urllib.parse import urlparse
except ImportError:
from urllib2 import urlopen, URLError
from urlparse import urlparse
proxy_settings = os.environ.get("http_proxy", None)
oe_core_layer = 'openembedded-core'
def _get_json_response(apiurl = self.apiurl):
_parsedurl = urlparse(apiurl)
path = _parsedurl.path
try:
res = urlopen(apiurl)
except URLError as e:
raise Exception("Failed to read %s: %s" % (path, e.reason))
return json.loads(res.read().decode('utf-8'))
# verify we can get the basic api
try:
apilinks = _get_json_response()
except Exception as e:
import traceback
if proxy_settings is not None:
logger.info("EE: Using proxy %s" % proxy_settings)
logger.warning("EE: could not connect to %s, skipping update: %s\n%s" % (self.apiurl, e, traceback.format_exc()))
return
# update branches; only those that we already have names listed in the
# Releases table
whitelist_branch_names = [rel.branch_name for rel in Release.objects.all()]
if len(whitelist_branch_names) == 0:
raise Exception("Failed to make list of branches to fetch")
logger.debug("Fetching branches")
branches_info = _get_json_response(apilinks['branches']
+ "?filter=name:%s" % "OR".join(whitelist_branch_names))
for bi in branches_info:
b, created = Branch.objects.get_or_create(layer_source = self, name = bi['name'])
b.up_id = bi['id']
b.up_date = bi['updated']
b.name = bi['name']
b.short_description = bi['short_description']
b.save()
# update layers
layers_info = _get_json_response(apilinks['layerItems'])
for li in layers_info:
# Special case for the openembedded-core layer
if li['name'] == oe_core_layer:
try:
# If we have an existing openembedded-core for example
# from the toasterconf.json augment the info using the
# layerindex rather than duplicate it
oe_core_l = Layer.objects.get(name=oe_core_layer)
# Take ownership of the layer as now coming from the
# layerindex
oe_core_l.layer_source = self
oe_core_l.up_id = li['id']
oe_core_l.summary = li['summary']
oe_core_l.description = li['description']
oe_core_l.save()
continue
except Layer.DoesNotExist:
pass
l, created = Layer.objects.get_or_create(layer_source = self, name = li['name'])
l.up_id = li['id']
l.up_date = li['updated']
l.vcs_url = li['vcs_url']
l.vcs_web_url = li['vcs_web_url']
l.vcs_web_tree_base_url = li['vcs_web_tree_base_url']
l.vcs_web_file_base_url = li['vcs_web_file_base_url']
l.summary = li['summary']
l.description = li['description']
l.save()
# update layerbranches/layer_versions
logger.debug("Fetching layer information")
layerbranches_info = _get_json_response(apilinks['layerBranches']
+ "?filter=branch:%s" % "OR".join(map(lambda x: str(x.up_id), [i for i in Branch.objects.filter(layer_source = self) if i.up_id is not None] ))
)
for lbi in layerbranches_info:
lv, created = Layer_Version.objects.get_or_create(layer_source = self,
up_id = lbi['id'],
layer=Layer.objects.get(layer_source = self, up_id = lbi['layer'])
)
lv.up_date = lbi['updated']
lv.up_branch = Branch.objects.get(layer_source = self, up_id = lbi['branch'])
lv.branch = lbi['actual_branch']
lv.commit = lbi['actual_branch']
lv.dirpath = lbi['vcs_subdir']
lv.save()
# update layer dependencies
layerdependencies_info = _get_json_response(apilinks['layerDependencies'])
dependlist = {}
for ldi in layerdependencies_info:
try:
lv = Layer_Version.objects.get(layer_source = self, up_id = ldi['layerbranch'])
except Layer_Version.DoesNotExist as e:
continue
if lv not in dependlist:
dependlist[lv] = []
try:
dependlist[lv].append(Layer_Version.objects.get(layer_source = self, layer__up_id = ldi['dependency'], up_branch = lv.up_branch))
except Layer_Version.DoesNotExist:
logger.warning("Cannot find layer version (ls:%s), up_id:%s lv:%s" % (self, ldi['dependency'], lv))
for lv in dependlist:
LayerVersionDependency.objects.filter(layer_version = lv).delete()
for lvd in dependlist[lv]:
LayerVersionDependency.objects.get_or_create(layer_version = lv, depends_on = lvd)
# update machines
logger.debug("Fetching machine information")
machines_info = _get_json_response(apilinks['machines']
+ "?filter=layerbranch:%s" % "OR".join(map(lambda x: str(x.up_id), Layer_Version.objects.filter(layer_source = self)))
)
for mi in machines_info:
mo, created = Machine.objects.get_or_create(layer_source = self, up_id = mi['id'], layer_version = Layer_Version.objects.get(layer_source = self, up_id = mi['layerbranch']))
mo.up_date = mi['updated']
mo.name = mi['name']
mo.description = mi['description']
mo.save()
# update recipes; paginate by layer version / layer branch
logger.debug("Fetching target information")
recipes_info = _get_json_response(apilinks['recipes']
+ "?filter=layerbranch:%s" % "OR".join(map(lambda x: str(x.up_id), Layer_Version.objects.filter(layer_source = self)))
)
for ri in recipes_info:
try:
ro, created = Recipe.objects.get_or_create(layer_source = self, up_id = ri['id'], layer_version = Layer_Version.objects.get(layer_source = self, up_id = ri['layerbranch']))
ro.up_date = ri['updated']
ro.name = ri['pn']
ro.version = ri['pv']
ro.summary = ri['summary']
ro.description = ri['description']
ro.section = ri['section']
ro.license = ri['license']
ro.homepage = ri['homepage']
ro.bugtracker = ri['bugtracker']
ro.file_path = ri['filepath'] + "/" + ri['filename']
if 'inherits' in ri:
ro.is_image = 'image' in ri['inherits'].split()
else: # workaround for old style layer index
ro.is_image = "-image-" in ri['pn']
ro.save()
except IntegrityError as e:
logger.debug("Failed saving recipe, ignoring: %s (%s:%s)" % (e, ro.layer_version, ri['filepath']+"/"+ri['filename']))
ro.delete()
class BitbakeVersion(models.Model):
@@ -1529,87 +1323,94 @@ class Release(models.Model):
def __unicode__(self):
return "%s (%s)" % (self.name, self.branch_name)
class ReleaseLayerSourcePriority(models.Model):
""" Each release selects layers from the set up layer sources, ordered by priority """
release = models.ForeignKey("Release")
layer_source = models.ForeignKey("LayerSource")
priority = models.IntegerField(default = 0)
def __unicode__(self):
return "%s-%s:%d" % (self.release.name, self.layer_source.name, self.priority)
class Meta:
unique_together = (('release', 'layer_source'),)
def __str__(self):
return self.name
class ReleaseDefaultLayer(models.Model):
release = models.ForeignKey(Release)
layer_name = models.CharField(max_length=100, default="")
# Branch class is synced with layerindex.Branch, branches can only come from remote layer indexes
class Branch(models.Model):
layer_source = models.ForeignKey('LayerSource', null = True, default = True)
up_id = models.IntegerField(null = True, default = None) # id of branch in the source
up_date = models.DateTimeField(null = True, default = None)
class LayerSource(object):
""" Where the layer metadata came from """
TYPE_LOCAL = 0
TYPE_LAYERINDEX = 1
TYPE_IMPORTED = 2
TYPE_BUILD = 3
name = models.CharField(max_length=50)
short_description = models.CharField(max_length=50, blank=True)
SOURCE_TYPE = (
(TYPE_LOCAL, "local"),
(TYPE_LAYERINDEX, "layerindex"),
(TYPE_IMPORTED, "imported"),
(TYPE_BUILD, "build"),
)
class Meta:
verbose_name_plural = "Branches"
unique_together = (('layer_source', 'name'),('layer_source', 'up_id'))
def __unicode__(self):
return self.name
def types_dict():
""" Turn the TYPES enums into a simple dictionary """
dictionary = {}
for key in LayerSource.__dict__:
if "TYPE" in key:
dictionary[key] = getattr(LayerSource, key)
return dictionary
# Layer class synced with layerindex.LayerItem
class Layer(models.Model):
layer_source = models.ForeignKey(LayerSource, null = True, default = None) # from where did we got this layer
up_id = models.IntegerField(null = True, default = None) # id of layer in the remote source
up_date = models.DateTimeField(null = True, default = None)
up_date = models.DateTimeField(null=True, default=timezone.now)
name = models.CharField(max_length=100)
layer_index_url = models.URLField()
vcs_url = GitURLField(default = None, null = True)
vcs_web_url = models.URLField(null = True, default = None)
vcs_web_tree_base_url = models.URLField(null = True, default = None)
vcs_web_file_base_url = models.URLField(null = True, default = None)
vcs_url = GitURLField(default=None, null=True)
local_source_dir = models.TextField(null = True, default = None)
vcs_web_url = models.URLField(null=True, default=None)
vcs_web_tree_base_url = models.URLField(null=True, default=None)
vcs_web_file_base_url = models.URLField(null=True, default=None)
summary = models.TextField(help_text='One-line description of the layer', null = True, default = None)
description = models.TextField(null = True, default = None)
summary = models.TextField(help_text='One-line description of the layer',
null=True, default=None)
description = models.TextField(null=True, default=None)
def __unicode__(self):
return "%s / %s " % (self.name, self.layer_source)
class Meta:
unique_together = (("layer_source", "up_id"), ("layer_source", "name"))
return "%s / %s " % (self.name, self.summary)
# LayerCommit class is synced with layerindex.LayerBranch
class Layer_Version(models.Model):
"""
A Layer_Version either belongs to a single project or no project
"""
search_allowed_fields = ["layer__name", "layer__summary", "layer__description", "layer__vcs_url", "dirpath", "up_branch__name", "commit", "branch"]
build = models.ForeignKey(Build, related_name='layer_version_build', default = None, null = True)
search_allowed_fields = ["layer__name", "layer__summary",
"layer__description", "layer__vcs_url",
"dirpath", "release__name", "commit", "branch"]
build = models.ForeignKey(Build, related_name='layer_version_build',
default=None, null=True)
layer = models.ForeignKey(Layer, related_name='layer_version_layer')
layer_source = models.ForeignKey(LayerSource, null = True, default = None) # from where did we get this Layer Version
up_id = models.IntegerField(null = True, default = None) # id of layerbranch in the remote source
up_date = models.DateTimeField(null = True, default = None)
up_branch = models.ForeignKey(Branch, null = True, default = None)
layer_source = models.IntegerField(choices=LayerSource.SOURCE_TYPE,
default=0)
branch = models.CharField(max_length=80) # LayerBranch.actual_branch
commit = models.CharField(max_length=100) # LayerBranch.vcs_last_rev
dirpath = models.CharField(max_length=255, null = True, default = None) # LayerBranch.vcs_subdir
priority = models.IntegerField(default = 0) # if -1, this is a default layer
up_date = models.DateTimeField(null=True, default=timezone.now)
local_path = models.FilePathField(max_length=1024, default = "/") # where this layer was checked-out
# To which metadata release does this layer version belong to
release = models.ForeignKey(Release, null=True, default=None)
project = models.ForeignKey('Project', null = True, default = None) # Set if this layer is project-specific; always set for imported layers, and project-set branches
branch = models.CharField(max_length=80)
commit = models.CharField(max_length=100)
# If the layer is in a subdir
dirpath = models.CharField(max_length=255, null=True, default=None)
# code lifted, with adaptations, from the layerindex-web application https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
# if -1, this is a default layer
priority = models.IntegerField(default=0)
# where this layer exists on the filesystem
local_path = models.FilePathField(max_length=1024, default="/")
# Set if this layer is restricted to a particular project
project = models.ForeignKey('Project', null=True, default=None)
# code lifted, with adaptations, from the layerindex-web application
# https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
def _handle_url_path(self, base_url, path):
import re, posixpath
if base_url:
@@ -1626,7 +1427,7 @@ class Layer_Version(models.Model):
extra_path = self.dirpath
else:
extra_path = path
branchname = self.up_branch.name
branchname = self.release.name
url = base_url.replace('%branch%', branchname)
# If there's a % in the path (e.g. a wildcard bbappend) we need to encode it
@@ -1651,23 +1452,19 @@ class Layer_Version(models.Model):
def get_vcs_file_link_url(self, file_path=""):
if self.layer.vcs_web_file_base_url is None:
return None
return self._handle_url_path(self.layer.vcs_web_file_base_url, file_path)
return self._handle_url_path(self.layer.vcs_web_file_base_url,
file_path)
def get_vcs_dirpath_link_url(self):
if self.layer.vcs_web_tree_base_url is None:
return None
return self._handle_url_path(self.layer.vcs_web_tree_base_url, '')
def get_equivalents_wpriority(self, project):
layer_versions = project.get_all_compatible_layer_versions()
filtered = layer_versions.filter(layer__name = self.layer.name)
return filtered.order_by("-layer_source__releaselayersourcepriority__priority")
def get_vcs_reference(self):
if self.branch is not None and len(self.branch) > 0:
return self.branch
if self.up_branch is not None:
return self.up_branch.name
if self.release is not None:
return self.release.name
if self.commit is not None and len(self.commit) > 0:
return self.commit
return 'N/A'
@@ -1695,20 +1492,23 @@ class Layer_Version(models.Model):
return sorted(result, key=lambda x: x.layer.name)
def __unicode__(self):
return "%d %s (VCS %s, Project %s)" % (self.pk, str(self.layer), self.get_vcs_reference(), self.build.project if self.build is not None else "No project")
return ("id %d belongs to layer: %s" % (self.pk, self.layer.name))
def __str__(self):
if self.release:
release = self.release.name
else:
release = "No release set"
return "%d %s (%s)" % (self.pk, self.layer.name, release)
class Meta:
unique_together = ("layer_source", "up_id")
class LayerVersionDependency(models.Model):
layer_source = models.ForeignKey(LayerSource, null = True, default = None) # from where did we got this layer
up_id = models.IntegerField(null = True, default = None) # id of layerbranch in the remote source
layer_version = models.ForeignKey(Layer_Version, related_name="dependencies")
depends_on = models.ForeignKey(Layer_Version, related_name="dependees")
class Meta:
unique_together = ("layer_source", "up_id")
layer_version = models.ForeignKey(Layer_Version,
related_name="dependencies")
depends_on = models.ForeignKey(Layer_Version,
related_name="dependees")
class ProjectLayer(models.Model):
project = models.ForeignKey(Project)

View File

@@ -1,180 +0,0 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2015 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""Test cases for Toaster ORM."""
from django.test import TestCase, TransactionTestCase
from orm.models import LocalLayerSource, LayerIndexLayerSource, ImportedLayerSource, LayerSource
from orm.models import Branch, LayerVersionDependency
from orm.models import Project, Layer, Layer_Version, Branch, ProjectLayer
from orm.models import Release, ReleaseLayerSourcePriority, BitbakeVersion
from django.db import IntegrityError
import os
# set TTS_LAYER_INDEX to the base url to use a different instance of the layer index
class LayerSourceVerifyInheritanceSaveLoad(TestCase):
"""
Tests to verify inheritance for the LayerSource proxy-inheritance classes.
"""
def test_object_creation(self):
"""Test LayerSource object creation."""
for name, sourcetype in [("a1", LayerSource.TYPE_LOCAL),
("a2", LayerSource.TYPE_LAYERINDEX),
("a3", LayerSource.TYPE_IMPORTED)]:
LayerSource.objects.create(name=name, sourcetype=sourcetype)
objects = LayerSource.objects.all()
self.assertTrue(isinstance(objects[0], LocalLayerSource))
self.assertTrue(isinstance(objects[1], LayerIndexLayerSource))
self.assertTrue(isinstance(objects[2], ImportedLayerSource))
def test_duplicate_error(self):
"""Test creation of duplicate LayerSource objects."""
stype = LayerSource.TYPE_LOCAL
LayerSource.objects.create(name="a1", sourcetype=stype)
with self.assertRaises(IntegrityError):
LayerSource.objects.create(name="a1", sourcetype=stype)
class LILSUpdateTestCase(TransactionTestCase):
"""Test Layer Source update."""
def setUp(self):
"""Create release."""
bbv = BitbakeVersion.objects.create(\
name="master", giturl="git://git.openembedded.org/bitbake")
Release.objects.create(name="default-release", bitbake_version=bbv,
branch_name="master")
def test_update(self):
"""Check if LayerSource.update can fetch branches."""
url = os.getenv("TTS_LAYER_INDEX",
default="http://layers.openembedded.org/")
lsobj = LayerSource.objects.create(\
name="b1", sourcetype=LayerSource.TYPE_LAYERINDEX,
apiurl=url + "layerindex/api/")
lsobj.update()
self.assertTrue(lsobj.branch_set.all().count() > 0,
"no branches fetched")
class LayerVersionEquivalenceTestCase(TestCase):
"""Verify Layer_Version priority selection."""
def setUp(self):
"""Create required objects."""
# create layer source
self.lsrc = LayerSource.objects.create(name="dummy-layersource",
sourcetype=LayerSource.TYPE_LOCAL)
# create release
bbv = BitbakeVersion.objects.create(\
name="master", giturl="git://git.openembedded.org/bitbake")
self.release = Release.objects.create(name="default-release",
bitbake_version=bbv,
branch_name="master")
# attach layer source to release
ReleaseLayerSourcePriority.objects.create(\
release=self.release, layer_source=self.lsrc, priority=1)
# create a layer version for the layer on the specified branch
self.layer = Layer.objects.create(name="meta-testlayer",
layer_source=self.lsrc)
self.branch = Branch.objects.create(name="master", layer_source=self.lsrc)
self.lver = Layer_Version.objects.create(\
layer=self.layer, layer_source=self.lsrc, up_branch=self.branch)
# create project and project layer
self.project = Project.objects.create_project(name="test-project",
release=self.release)
ProjectLayer.objects.create(project=self.project,
layercommit=self.lver)
# create spoof layer that should not appear in the search results
layer = Layer.objects.create(name="meta-notvalid",
layer_source=self.lsrc)
self.lver2 = Layer_Version.objects.create(layer=layer,
layer_source=self.lsrc,
up_branch=self.branch)
def test_single_layersource(self):
"""
When we have a single layer version,
get_equivalents_wpriority() should return a list with
just this layer_version.
"""
equivqs = self.lver.get_equivalents_wpriority(self.project)
self.assertEqual(list(equivqs), [self.lver])
def test_dual_layersource(self):
"""
If we have two layers with the same name, from different layer sources,
we expect both layers in, in increasing priority of the layer source.
"""
lsrc2 = LayerSource.objects.create(\
name="dummy-layersource2",
sourcetype=LayerSource.TYPE_LOCAL,
apiurl="test")
# assign a lower priority for the second layer source
self.release.releaselayersourcepriority_set.create(layer_source=lsrc2,
priority=2)
# create a new layer_version for a layer with the same name
# coming from the second layer source
layer2 = Layer.objects.create(name="meta-testlayer",
layer_source=lsrc2)
lver2 = Layer_Version.objects.create(layer=layer2, layer_source=lsrc2,
up_branch=self.branch)
# expect two layer versions, in the priority order
equivqs = self.lver.get_equivalents_wpriority(self.project)
self.assertEqual(list(equivqs), [lver2, self.lver])
def test_compatible_layer_versions(self):
"""
When we have a 2 layer versions, get_all_compatible_layerversions()
should return a queryset with both.
"""
compat_lv = self.project.get_all_compatible_layer_versions()
self.assertEqual(list(compat_lv), [self.lver, self.lver2])
def test_layerversion_get_alldeps(self):
"""Test Layer_Version.get_alldeps API."""
lvers = {}
for i in range(10):
name = "layer%d" % i
lvers[name] = Layer_Version.objects.create(layer=Layer.objects.create(name=name),
project=self.project)
if i:
LayerVersionDependency.objects.create(layer_version=lvers["layer%d" % (i - 1)],
depends_on=lvers[name])
# Check dinamically added deps
self.assertEqual(lvers['layer0'].get_alldeps(self.project.id),
[lvers['layer%d' % n] for n in range(1, i+1)])
# Check chain of deps created in previous loop
for i in range(10):
self.assertEqual(lvers['layer%d' % i].get_alldeps(self.project.id),
[lvers['layer%d' % n] for n in range(i+1, 10)])

View File

@@ -13,7 +13,7 @@ a Selenium test report with a version-specific format.
To run tests against Chrome:
* Download chromedriver for your host OS from
https://code.google.com/p/chromedriver/downloads/list
https://sites.google.com/a/chromium.org/chromedriver/downloads
* On *nix systems, put chromedriver on PATH
* On Windows, put chromedriver.exe in the same directory as chrome.exe
@@ -24,15 +24,30 @@ To run tests against PhantomJS (headless):
* On *nix systems, put phantomjs on PATH
* Not tested on Windows
Firefox should work without requiring additional software to be installed.
To run tests against Firefox, you may need to install the Marionette driver,
depending on how new your version of Firefox is. One clue that you need to do
this is if you see an exception like:
The test case will instantiate a Selenium driver set by the
selenium.common.exceptions.WebDriverException: Message: The browser
appears to have exited before we could connect. If you specified
a log_file in the FirefoxBinary constructor, check it for details.
See https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
for installation instructions. Ensure that the Marionette executable (renamed
as wires on Linux or wires.exe on Windows) is on your PATH; and use "marionette"
as the browser string passed via TOASTER_TESTS_BROWSER (see below).
(Note: The Toaster tests have been checked against Firefox 47 with the
Marionette driver.)
The test cases will instantiate a Selenium driver set by the
TOASTER_TESTS_BROWSER environment variable, or Chrome if this is not specified.
Available drivers:
* chrome (default)
* firefox
* marionette (for newer Firefoxes)
* ie
* phantomjs

View File

@@ -0,0 +1,218 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The Wait class and some of SeleniumDriverHelper and SeleniumTestCase are
# modified from Patchwork, released under the same licence terms as Toaster:
# https://github.com/dlespiau/patchwork/blob/master/patchwork/tests.browser.py
"""
Helper methods for creating Toaster Selenium tests which run within
the context of Django unit tests.
"""
import os
import time
import unittest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.common.exceptions import NoSuchElementException, \
StaleElementReferenceException, TimeoutException
def create_selenium_driver(browser='chrome'):
# set default browser string based on env (if available)
env_browser = os.environ.get('TOASTER_TESTS_BROWSER')
if env_browser:
browser = env_browser
if browser == 'chrome':
return webdriver.Chrome(
service_args=["--verbose", "--log-path=selenium.log"]
)
elif browser == 'firefox':
return webdriver.Firefox()
elif browser == 'marionette':
capabilities = DesiredCapabilities.FIREFOX
capabilities['marionette'] = True
return webdriver.Firefox(capabilities=capabilities)
elif browser == 'ie':
return webdriver.Ie()
elif browser == 'phantomjs':
return webdriver.PhantomJS()
else:
msg = 'Selenium driver for browser %s is not available' % browser
raise RuntimeError(msg)
class Wait(WebDriverWait):
"""
Subclass of WebDriverWait with predetermined timeout and poll
frequency. Also deals with a wider variety of exceptions.
"""
_TIMEOUT = 10
_POLL_FREQUENCY = 0.5
def __init__(self, driver):
super(Wait, self).__init__(driver, self._TIMEOUT, self._POLL_FREQUENCY)
def until(self, method, message=''):
"""
Calls the method provided with the driver as an argument until the
return value is not False.
"""
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except NoSuchElementException:
pass
except StaleElementReferenceException:
pass
time.sleep(self._poll)
if time.time() > end_time:
break
raise TimeoutException(message)
def until_not(self, method, message=''):
"""
Calls the method provided with the driver as an argument until the
return value is False.
"""
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if not value:
return value
except NoSuchElementException:
return True
except StaleElementReferenceException:
pass
time.sleep(self._poll)
if time.time() > end_time:
break
raise TimeoutException(message)
class SeleniumTestCaseBase(unittest.TestCase):
"""
NB StaticLiveServerTestCase is used as the base test case so that
static files are served correctly in a Selenium test run context; see
https://docs.djangoproject.com/en/1.9/ref/contrib/staticfiles/#specialized-test-case-to-support-live-testing
"""
@classmethod
def setUpClass(cls):
""" Create a webdriver driver at the class level """
super(SeleniumTestCaseBase, cls).setUpClass()
# instantiate the Selenium webdriver once for all the test methods
# in this test case
cls.driver = create_selenium_driver()
cls.driver.maximize_window()
@classmethod
def tearDownClass(cls):
""" Clean up webdriver driver """
cls.driver.quit()
super(SeleniumTestCaseBase, cls).tearDownClass()
def get(self, url):
"""
Selenium requires absolute URLs, so convert Django URLs returned
by resolve() or similar to absolute ones and get using the
webdriver instance.
url: a relative URL
"""
abs_url = '%s%s' % (self.live_server_url, url)
self.driver.get(abs_url)
def find(self, selector):
""" Find single element by CSS selector """
return self.driver.find_element_by_css_selector(selector)
def find_all(self, selector):
""" Find all elements matching CSS selector """
return self.driver.find_elements_by_css_selector(selector)
def element_exists(self, selector):
"""
Return True if one element matching selector exists,
False otherwise
"""
return len(self.find_all(selector)) == 1
def focused_element(self):
""" Return the element which currently has focus on the page """
return self.driver.switch_to.active_element
def wait_until_present(self, selector):
""" Wait until element matching CSS selector is on the page """
is_present = lambda driver: self.find(selector)
msg = 'An element matching "%s" should be on the page' % selector
element = Wait(self.driver).until(is_present, msg)
return element
def wait_until_visible(self, selector):
""" Wait until element matching CSS selector is visible on the page """
is_visible = lambda driver: self.find(selector).is_displayed()
msg = 'An element matching "%s" should be visible' % selector
Wait(self.driver).until(is_visible, msg)
return self.find(selector)
def wait_until_focused(self, selector):
""" Wait until element matching CSS selector has focus """
is_focused = \
lambda driver: self.find(selector) == self.focused_element()
msg = 'An element matching "%s" should be focused' % selector
Wait(self.driver).until(is_focused, msg)
return self.find(selector)
def enter_text(self, selector, value):
""" Insert text into element matching selector """
# note that keyup events don't occur until the element is clicked
# (in the case of <input type="text"...>, for example), so simulate
# user clicking the element before inserting text into it
field = self.click(selector)
field.send_keys(value)
return field
def click(self, selector):
""" Click on element which matches CSS selector """
element = self.wait_until_visible(selector)
element.click()
return element
def get_page_source(self):
""" Get raw HTML for the current page """
return self.driver.page_source

View File

@@ -58,6 +58,13 @@ class TestAllBuildsPage(SeleniumTestCase):
'outcome': Build.SUCCEEDED
}
self.project1_build_failure = {
'project': self.project1,
'started_on': now,
'completed_on': now,
'outcome': Build.FAILED
}
self.default_project_build_success = {
'project': self.default_project,
'started_on': now,
@@ -65,6 +72,46 @@ class TestAllBuildsPage(SeleniumTestCase):
'outcome': Build.SUCCEEDED
}
def _get_build_time_element(self, build):
"""
Return the HTML element containing the build time for a build
in the recent builds area
"""
selector = 'div[data-latest-build-result="%s"] ' \
'[data-role="data-recent-build-buildtime-field"]' % build.id
# because this loads via Ajax, wait for it to be visible
self.wait_until_present(selector)
build_time_spans = self.find_all(selector)
self.assertEqual(len(build_time_spans), 1)
return build_time_spans[0]
def _get_row_for_build(self, build):
""" Get the table row for the build from the all builds table """
self.wait_until_present('#allbuildstable')
rows = self.find_all('#allbuildstable tr')
# look for the row with a download link on the recipe which matches the
# build ID
url = reverse('builddashboard', args=(build.id,))
selector = 'td.target a[href="%s"]' % url
found_row = None
for row in rows:
outcome_links = row.find_elements_by_css_selector(selector)
if len(outcome_links) == 1:
found_row = row
break
self.assertNotEqual(found_row, None)
return found_row
def test_show_tasks_with_suffix(self):
""" Task should be shown as suffix on build name """
build = Build.objects.create(**self.project1_build_success)
@@ -97,13 +144,13 @@ class TestAllBuildsPage(SeleniumTestCase):
self.get(url)
# shouldn't see a rebuild button for command-line builds
selector = 'div[data-latest-build-result="%s"] a.run-again-btn' % default_build.id
selector = 'div[data-latest-build-result="%s"] .rebuild-btn' % default_build.id
run_again_button = self.find_all(selector)
self.assertEqual(len(run_again_button), 0,
'should not see a rebuild button for cli builds')
# should see a rebuild button for non-command-line builds
selector = 'div[data-latest-build-result="%s"] a.run-again-btn' % build1.id
selector = 'div[data-latest-build-result="%s"] .rebuild-btn' % build1.id
run_again_button = self.find_all(selector)
self.assertEqual(len(run_again_button), 1,
'should see a rebuild button for non-cli builds')
@@ -142,3 +189,45 @@ class TestAllBuildsPage(SeleniumTestCase):
else:
msg = 'found unexpected project name cell in all builds table'
self.fail(msg)
def test_builds_time_links(self):
"""
Successful builds should have links on the time column and in the
recent builds area; failed builds should not have links on the time column,
or in the recent builds area
"""
build1 = Build.objects.create(**self.project1_build_success)
build2 = Build.objects.create(**self.project1_build_failure)
# add some targets to these builds so they have recipe links
# (and so we can find the row in the ToasterTable corresponding to
# a particular build)
Target.objects.create(build=build1, target='foo')
Target.objects.create(build=build2, target='bar')
url = reverse('all-builds')
self.get(url)
# test recent builds area for successful build
element = self._get_build_time_element(build1)
links = element.find_elements_by_css_selector('a')
msg = 'should be a link on the build time for a successful recent build'
self.assertEquals(len(links), 1, msg)
# test recent builds area for failed build
element = self._get_build_time_element(build2)
links = element.find_elements_by_css_selector('a')
msg = 'should not be a link on the build time for a failed recent build'
self.assertEquals(len(links), 0, msg)
# test the time column for successful build
build1_row = self._get_row_for_build(build1)
links = build1_row.find_elements_by_css_selector('td.time a')
msg = 'should be a link on the build time for a successful build'
self.assertEquals(len(links), 1, msg)
# test the time column for failed build
build2_row = self._get_row_for_build(build2)
links = build2_row.find_elements_by_css_selector('td.time a')
msg = 'should not be a link on the build time for a failed build'
self.assertEquals(len(links), 0, msg)

View File

@@ -25,7 +25,7 @@ from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import Project, Release, BitbakeVersion, Build, LogMessage
from orm.models import Layer, Layer_Version, Recipe, CustomImageRecipe
from orm.models import Layer, Layer_Version, Recipe, CustomImageRecipe, Variable
class TestBuildDashboardPage(SeleniumTestCase):
""" Tests for the build dashboard /build/X """
@@ -42,15 +42,27 @@ class TestBuildDashboardPage(SeleniumTestCase):
self.build1 = Build.objects.create(project=project,
started_on=now,
completed_on=now)
completed_on=now,
outcome=Build.SUCCEEDED)
self.build2 = Build.objects.create(project=project,
started_on=now,
completed_on=now)
completed_on=now,
outcome=Build.SUCCEEDED)
self.build3 = Build.objects.create(project=project,
started_on=now,
completed_on=now)
completed_on=now,
outcome=Build.FAILED)
# add Variable objects to the successful builds, as this is the criterion
# used to determine whether the left-hand panel should be displayed
Variable.objects.create(build=self.build1,
variable_name='Foo',
variable_value='Bar')
Variable.objects.create(build=self.build2,
variable_name='Foo',
variable_value='Bar')
# exception
msg1 = 'an exception was thrown'
@@ -68,6 +80,22 @@ class TestBuildDashboardPage(SeleniumTestCase):
message=msg2
)
# error on the failed build
msg3 = 'an error occurred'
self.error_message = LogMessage.objects.create(
build=self.build3,
level=LogMessage.ERROR,
message=msg3
)
# warning on the failed build
msg4 = 'DANGER WILL ROBINSON'
self.warning_message = LogMessage.objects.create(
build=self.build3,
level=LogMessage.WARNING,
message=msg4
)
# recipes related to the build, for testing the edit custom image/new
# custom image buttons
layer = Layer.objects.create(name='alayer')
@@ -151,36 +179,45 @@ class TestBuildDashboardPage(SeleniumTestCase):
self._get_build_dashboard(build)
return self.find_all('#errors div.alert-danger')
def _check_for_log_message(self, build, log_message):
def _check_for_log_message(self, message_elements, log_message):
"""
Check that the LogMessage <log_message> has a representation in
the HTML elements <message_elements>.
message_elements: WebElements representing the log messages shown
in the build dashboard; each should have a <pre> element inside
it with a data-log-message-id attribute
log_message: orm.models.LogMessage instance
"""
expected_text = log_message.message
expected_pk = str(log_message.pk)
found = False
for element in message_elements:
log_message_text = element.find_element_by_tag_name('pre').text.strip()
text_matches = (log_message_text == expected_text)
log_message_pk = element.get_attribute('data-log-message-id')
id_matches = (log_message_pk == expected_pk)
if text_matches and id_matches:
found = True
break
template_vars = (expected_text, expected_pk)
assertion_failed_msg = 'message not found: ' \
'expected text "%s" and ID %s' % template_vars
self.assertTrue(found, assertion_failed_msg)
def _check_for_error_message(self, build, log_message):
"""
Check whether the LogMessage instance <log_message> is
represented as an HTML error in the dashboard page for the Build object
build
"""
errors = self._get_build_dashboard_errors(build)
self.assertEqual(len(errors), 2)
expected_text = log_message.message
expected_id = str(log_message.id)
found = False
for error in errors:
error_text = error.find_element_by_tag_name('pre').text
text_matches = (error_text == expected_text)
error_id = error.get_attribute('data-error')
id_matches = (error_id == expected_id)
if text_matches and id_matches:
found = True
break
template_vars = (expected_text, error_text,
expected_id, error_id)
assertion_error_msg = 'exception not found as error: ' \
'expected text "%s" and got "%s"; ' \
'expected ID %s and got %s' % template_vars
self.assertTrue(found, assertion_error_msg)
self._check_for_log_message(errors, log_message)
def _check_labels_in_modal(self, modal, expected):
"""
@@ -203,14 +240,14 @@ class TestBuildDashboardPage(SeleniumTestCase):
LogMessages with level EXCEPTION should display in the errors
section of the page
"""
self._check_for_log_message(self.build1, self.exception_message)
self._check_for_error_message(self.build1, self.exception_message)
def test_criticals_show_as_errors(self):
"""
LogMessages with level CRITICAL should display in the errors
section of the page
"""
self._check_for_log_message(self.build1, self.critical_message)
self._check_for_error_message(self.build1, self.critical_message)
def test_edit_custom_image_button(self):
"""
@@ -268,3 +305,43 @@ class TestBuildDashboardPage(SeleniumTestCase):
self.assertFalse(self.element_exists(selector),
'new custom image button should not show for builds which ' \
'don\'t have any image recipes')
def test_left_panel(self):
""""
Builds which succeed should have a left panel and a build summary
"""
self._get_build_dashboard(self.build1)
left_panel = self.find_all('#nav')
self.assertEqual(len(left_panel), 1)
build_summary = self.find_all('[data-role="build-summary-heading"]')
self.assertEqual(len(build_summary), 1)
def test_failed_no_left_panel(self):
"""
Builds which fail should have no left panel and no build summary
"""
self._get_build_dashboard(self.build3)
left_panel = self.find_all('#nav')
self.assertEqual(len(left_panel), 0)
build_summary = self.find_all('[data-role="build-summary-heading"]')
self.assertEqual(len(build_summary), 0)
def test_failed_shows_errors_and_warnings(self):
"""
Failed builds should still show error and warning messages
"""
self._get_build_dashboard(self.build3)
errors = self.find_all('#errors div.alert-danger')
self._check_for_log_message(errors, self.error_message)
# expand the warnings area
self.click('#warning-toggle')
self.wait_until_visible('#warnings div.alert-warning')
warnings = self.find_all('#warnings div.alert-warning')
self._check_for_log_message(warnings, self.warning_message)

View File

@@ -26,7 +26,7 @@ from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import Project, Release, BitbakeVersion, Build, Target, Package
from orm.models import Target_Image_File, TargetSDKFile, TargetKernelFile
from orm.models import Target_Installed_Package
from orm.models import Target_Installed_Package, Variable
class TestBuildDashboardPageArtifacts(SeleniumTestCase):
""" Tests for artifacts on the build dashboard /build/X """
@@ -151,6 +151,11 @@ class TestBuildDashboardPageArtifacts(SeleniumTestCase):
started_on=now, completed_on=timezone.now(),
outcome=Build.SUCCEEDED)
# add a variable to the build so that it counts as "started"
Variable.objects.create(build=build,
variable_name='Christopher',
variable_value='Lee')
target = Target.objects.create(is_image=True, build=build,
task='', target='core-image-minimal',
license_manifest_path='/home/foo/license.manifest',

View File

@@ -0,0 +1,66 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.core.urlresolvers import reverse
from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version
from orm.models import Target
class TestBuilddashboardPageRecipes(SeleniumTestCase):
""" Test build dashboard recipes sub-page """
def setUp(self):
project = Project.objects.get_or_create_default_project()
now = timezone.now()
self.build = Build.objects.create(project=project,
started_on=now,
completed_on=now)
layer = Layer.objects.create()
layer_version = Layer_Version.objects.create(layer=layer,
build=self.build)
recipe = Recipe.objects.create(layer_version=layer_version)
task = Task.objects.create(build=self.build, recipe=recipe, order=1)
Target.objects.create(build=self.build, task=task, target='do_build')
def test_build_recipes_columns(self):
"""
Check that non-hideable columns of the table on the recipes sub-page
are disabled on the edit columns dropdown.
"""
url = reverse('recipes', args=(self.build.id,))
self.get(url)
self.wait_until_visible('#edit-columns-button')
# check that options for the non-hideable columns are disabled
non_hideable = ['name', 'version']
for column in non_hideable:
selector = 'input#checkbox-%s[disabled="disabled"]' % column
self.wait_until_present(selector)

View File

@@ -0,0 +1,65 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.core.urlresolvers import reverse
from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import Project, Build, Recipe, Task, Layer, Layer_Version
from orm.models import Target
class TestBuilddashboardPageTasks(SeleniumTestCase):
""" Test build dashboard tasks sub-page """
def setUp(self):
project = Project.objects.get_or_create_default_project()
now = timezone.now()
self.build = Build.objects.create(project=project,
started_on=now,
completed_on=now)
layer = Layer.objects.create()
layer_version = Layer_Version.objects.create(layer=layer)
recipe = Recipe.objects.create(layer_version=layer_version)
task = Task.objects.create(build=self.build, recipe=recipe, order=1)
Target.objects.create(build=self.build, task=task, target='do_build')
def test_build_tasks_columns(self):
"""
Check that non-hideable columns of the table on the tasks sub-page
are disabled on the edit columns dropdown.
"""
url = reverse('tasks', args=(self.build.id,))
self.get(url)
self.wait_until_visible('#edit-columns-button')
# check that options for the non-hideable columns are disabled
non_hideable = ['order', 'task_name', 'recipe__name']
for column in non_hideable:
selector = 'input#checkbox-%s[disabled="disabled"]' % column
self.wait_until_present(selector)

View File

@@ -49,9 +49,6 @@ class TestLayerDetailsPage(SeleniumTestCase):
# project to add new custom images to
self.project = Project.objects.create(name='foo', release=release)
layer_source = LayerSource.objects.create(
sourcetype=LayerSource.TYPE_IMPORTED)
name = "meta-imported"
vcs_url = "git://example.com/meta-imported"
subdir = "/layer"
@@ -66,7 +63,7 @@ class TestLayerDetailsPage(SeleniumTestCase):
self.imported_layer_version = Layer_Version.objects.create(
layer=imported_layer,
layer_source=layer_source,
layer_source=LayerSource.TYPE_IMPORTED,
branch=gitrev,
commit=gitrev,
dirpath=subdir,
@@ -116,8 +113,8 @@ class TestLayerDetailsPage(SeleniumTestCase):
new_values = ["%s-edited" % old_val
for old_val in self.initial_values]
for inputs in self.find_all("dd input[type=text]") + \
self.find_all("dd textarea"):
for inputs in self.find_all('dd input[type="text"]') + \
self.find_all('dd textarea'):
# ignore the tt inputs (twitter typeahead input)
if "tt-" in inputs.get_attribute("class"):
continue
@@ -125,8 +122,8 @@ class TestLayerDetailsPage(SeleniumTestCase):
value = inputs.get_attribute("value")
self.assertTrue(value in new_values,
"Expecting any of \"%s\"but got \"%s\"" %
(self.initial_values, value))
"Expecting any of \"%s\" but got \"%s\"" %
(new_values, value))
def test_delete_layer(self):
""" Delete the layer """

View File

@@ -0,0 +1,211 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.core.urlresolvers import reverse
from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from tests.browser.selenium_helpers_base import Wait
from orm.models import Project, Build, Task, Recipe, Layer, Layer_Version
from bldcontrol.models import BuildRequest
class TestMostRecentBuildsStates(SeleniumTestCase):
""" Test states update correctly in most recent builds area """
def _create_build_request(self):
project = Project.objects.get_or_create_default_project()
now = timezone.now()
build = Build.objects.create(project=project, build_name='fakebuild',
started_on=now, completed_on=now)
return BuildRequest.objects.create(build=build, project=project,
state=BuildRequest.REQ_QUEUED)
def _create_recipe(self):
""" Add a recipe to the database and return it """
layer = Layer.objects.create()
layer_version = Layer_Version.objects.create(layer=layer)
return Recipe.objects.create(name='foo', layer_version=layer_version)
def _check_build_states(self, build_request):
recipes_to_parse = 10
url = reverse('all-builds')
self.get(url)
build = build_request.build
base_selector = '[data-latest-build-result="%s"] ' % build.id
# build queued; check shown as queued
selector = base_selector + '[data-build-state="Queued"]'
element = self.wait_until_visible(selector)
self.assertRegexpMatches(element.get_attribute('innerHTML'),
'Build queued', 'build should show queued status')
# waiting for recipes to be parsed
build.outcome = Build.IN_PROGRESS
build.recipes_to_parse = recipes_to_parse
build.recipes_parsed = 0
build_request.state = BuildRequest.REQ_INPROGRESS
build_request.save()
self.get(url)
selector = base_selector + '[data-build-state="Parsing"]'
element = self.wait_until_visible(selector)
bar_selector = '#recipes-parsed-percentage-bar-%s' % build.id
bar_element = element.find_element_by_css_selector(bar_selector)
self.assertEqual(bar_element.value_of_css_property('width'), '0px',
'recipe parse progress should be at 0')
# recipes being parsed; check parse progress
build.recipes_parsed = 5
build.save()
self.get(url)
element = self.wait_until_visible(selector)
bar_element = element.find_element_by_css_selector(bar_selector)
recipe_bar_updated = lambda driver: \
bar_element.get_attribute('style') == 'width: 50%;'
msg = 'recipe parse progress bar should update to 50%'
element = Wait(self.driver).until(recipe_bar_updated, msg)
# all recipes parsed, task started, waiting for first task to finish;
# check status is shown as "Tasks starting..."
build.recipes_parsed = recipes_to_parse
build.save()
recipe = self._create_recipe()
task1 = Task.objects.create(build=build, recipe=recipe,
task_name='Lionel')
task2 = Task.objects.create(build=build, recipe=recipe,
task_name='Jeffries')
self.get(url)
selector = base_selector + '[data-build-state="Starting"]'
element = self.wait_until_visible(selector)
self.assertRegexpMatches(element.get_attribute('innerHTML'),
'Tasks starting', 'build should show "tasks starting" status')
# first task finished; check tasks progress bar
task1.order = 1
task1.save()
self.get(url)
selector = base_selector + '[data-build-state="In Progress"]'
element = self.wait_until_visible(selector)
bar_selector = '#build-pc-done-bar-%s' % build.id
bar_element = element.find_element_by_css_selector(bar_selector)
task_bar_updated = lambda driver: \
bar_element.get_attribute('style') == 'width: 50%;'
msg = 'tasks progress bar should update to 50%'
element = Wait(self.driver).until(task_bar_updated, msg)
# last task finished; check tasks progress bar updates
task2.order = 2
task2.save()
self.get(url)
element = self.wait_until_visible(selector)
bar_element = element.find_element_by_css_selector(bar_selector)
task_bar_updated = lambda driver: \
bar_element.get_attribute('style') == 'width: 100%;'
msg = 'tasks progress bar should update to 100%'
element = Wait(self.driver).until(task_bar_updated, msg)
def test_states_to_success(self):
"""
Test state transitions in the recent builds area for a build which
completes successfully.
"""
build_request = self._create_build_request()
self._check_build_states(build_request)
# all tasks complete and build succeeded; check success state shown
build = build_request.build
build.outcome = Build.SUCCEEDED
build.save()
selector = '[data-latest-build-result="%s"] ' \
'[data-build-state="Succeeded"]' % build.id
element = self.wait_until_visible(selector)
def test_states_to_failure(self):
"""
Test state transitions in the recent builds area for a build which
completes in a failure.
"""
build_request = self._create_build_request()
self._check_build_states(build_request)
# all tasks complete and build succeeded; check fail state shown
build = build_request.build
build.outcome = Build.FAILED
build.save()
selector = '[data-latest-build-result="%s"] ' \
'[data-build-state="Failed"]' % build.id
element = self.wait_until_visible(selector)
def test_states_cancelling(self):
"""
Test that most recent build area updates correctly for a build
which is cancelled.
"""
url = reverse('all-builds')
build_request = self._create_build_request()
build = build_request.build
# cancel the build
build_request.state = BuildRequest.REQ_CANCELLING
build_request.save()
self.get(url)
# check cancelling state
selector = '[data-latest-build-result="%s"] ' \
'[data-build-state="Cancelling"]' % build.id
element = self.wait_until_visible(selector)
self.assertRegexpMatches(element.get_attribute('innerHTML'),
'Cancelling the build', 'build should show "cancelling" status')
# check cancelled state
build.outcome = Build.CANCELLED
build.save()
self.get(url)
selector = '[data-latest-build-result="%s"] ' \
'[data-build-state="Cancelled"]' % build.id
element = self.wait_until_visible(selector)
self.assertRegexpMatches(element.get_attribute('innerHTML'),
'Build cancelled', 'build should show "cancelled" status')

View File

@@ -22,6 +22,7 @@
from django.core.urlresolvers import reverse
from tests.browser.selenium_helpers import SeleniumTestCase
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import InvalidElementStateException
from orm.models import Project, Release, BitbakeVersion
@@ -102,7 +103,10 @@ class TestNewProjectPage(SeleniumTestCase):
# Try and click it anyway, if it submits we'll have a new project in
# the db and assert then
self.click("#create-project-button")
try:
self.click("#create-project-button")
except InvalidElementStateException:
pass
self.assertTrue(
(Project.objects.filter(name=project_name).count() == 1),

View File

@@ -0,0 +1,76 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.core.urlresolvers import reverse
from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import Project, Build, Layer, Layer_Version, Recipe, Target
from orm.models import Task, Task_Dependency
class TestTaskPage(SeleniumTestCase):
""" Test page which shows an individual task """
RECIPE_NAME = 'bar'
RECIPE_VERSION = '0.1'
TASK_NAME = 'do_da_doo_ron_ron'
def setUp(self):
now = timezone.now()
project = Project.objects.get_or_create_default_project()
self.build = Build.objects.create(project=project, started_on=now,
completed_on=now)
Target.objects.create(target='foo', build=self.build)
layer = Layer.objects.create()
layer_version = Layer_Version.objects.create(layer=layer)
recipe = Recipe.objects.create(name=TestTaskPage.RECIPE_NAME,
layer_version=layer_version, version=TestTaskPage.RECIPE_VERSION)
self.task = Task.objects.create(build=self.build, recipe=recipe,
order=1, outcome=Task.OUTCOME_COVERED, task_executed=False,
task_name=TestTaskPage.TASK_NAME)
def test_covered_task(self):
"""
Check that covered tasks are displayed for tasks which have
dependencies on themselves
"""
# the infinite loop which of bug 9952 was down to tasks which
# depend on themselves, so add self-dependent tasks to replicate the
# situation which caused the infinite loop (now fixed)
Task_Dependency.objects.create(task=self.task, depends_on=self.task)
url = reverse('task', args=(self.build.id, self.task.id,))
self.get(url)
# check that we see the task name
self.wait_until_visible('.page-header h1')
heading = self.find('.page-header h1')
expected_heading = '%s_%s %s' % (TestTaskPage.RECIPE_NAME,
TestTaskPage.RECIPE_VERSION, TestTaskPage.TASK_NAME)
self.assertEqual(heading.text, expected_heading,
'Heading should show recipe name, version and task')

View File

@@ -0,0 +1,160 @@
#! /usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
# BitBake Toaster Implementation
#
# Copyright (C) 2013-2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from datetime import datetime
from django.core.urlresolvers import reverse
from django.utils import timezone
from tests.browser.selenium_helpers import SeleniumTestCase
from orm.models import BitbakeVersion, Release, Project, Build
class TestToasterTableUI(SeleniumTestCase):
"""
Tests for the UI elements of ToasterTable (sorting etc.);
note that the tests cover generic functionality of ToasterTable which
manifests as UI elements in the browser, and can only be tested via
Selenium.
"""
def setUp(self):
pass
def _get_orderby_heading(self, table):
"""
Get the current order by finding the column heading in <table> with
the sorted class on it.
table: WebElement for a ToasterTable
"""
selector = 'thead a.sorted'
heading = table.find_element_by_css_selector(selector)
return heading.get_attribute('innerHTML').strip()
def _get_datetime_from_cell(self, row, selector):
"""
Return the value in the cell selected by <selector> on <row> as a
datetime.
row: <tr> WebElement for a row in the ToasterTable
selector: CSS selector to use to find the cell containing the date time
string
"""
cell = row.find_element_by_css_selector(selector)
cell_text = cell.get_attribute('innerHTML').strip()
return datetime.strptime(cell_text, '%d/%m/%y %H:%M')
def test_revert_orderby(self):
"""
Test that sort order for a table reverts to the default sort order
if the current sort column is hidden.
"""
now = timezone.now()
later = now + timezone.timedelta(hours=1)
even_later = later + timezone.timedelta(hours=1)
bbv = BitbakeVersion.objects.create(name='test bbv', giturl='/tmp/',
branch='master', dirpath='')
release = Release.objects.create(name='test release',
branch_name='master',
bitbake_version=bbv)
project = Project.objects.create_project('project', release)
# set up two builds which will order differently when sorted by
# started_on or completed_on
# started first, finished last
build1 = Build.objects.create(project=project,
started_on=now,
completed_on=even_later,
outcome=Build.SUCCEEDED)
# started second, finished first
build2 = Build.objects.create(project=project,
started_on=later,
completed_on=later,
outcome=Build.SUCCEEDED)
url = reverse('all-builds')
self.get(url)
table = self.wait_until_visible('#allbuildstable')
# check ordering (default is by -completed_on); so build1 should be
# first as it finished last
active_heading = self._get_orderby_heading(table)
self.assertEqual(active_heading, 'Completed on',
'table should be sorted by "Completed on" by default')
row_selector = '#allbuildstable tbody tr'
cell_selector = 'td.completed_on'
rows = self.find_all(row_selector)
row1_completed_on = self._get_datetime_from_cell(rows[0], cell_selector)
row2_completed_on = self._get_datetime_from_cell(rows[1], cell_selector)
self.assertTrue(row1_completed_on > row2_completed_on,
'table should be sorted by -completed_on')
# turn on started_on column
self.click('#edit-columns-button')
self.click('#checkbox-started_on')
# sort by started_on column
links = table.find_elements_by_css_selector('th.started_on a')
for link in links:
if link.get_attribute('innerHTML').strip() == 'Started on':
link.click()
break
# wait for table data to reload in response to new sort
self.wait_until_visible('#allbuildstable')
# check ordering; build1 should be first
active_heading = self._get_orderby_heading(table)
self.assertEqual(active_heading, 'Started on',
'table should be sorted by "Started on"')
cell_selector = 'td.started_on'
rows = self.find_all(row_selector)
row1_started_on = self._get_datetime_from_cell(rows[0], cell_selector)
row2_started_on = self._get_datetime_from_cell(rows[1], cell_selector)
self.assertTrue(row1_started_on < row2_started_on,
'table should be sorted by started_on')
# turn off started_on column
self.click('#edit-columns-button')
self.click('#checkbox-started_on')
# wait for table data to reload in response to new sort
self.wait_until_visible('#allbuildstable')
# check ordering (should revert to completed_on); build2 should be first
active_heading = self._get_orderby_heading(table)
self.assertEqual(active_heading, 'Completed on',
'table should be sorted by "Completed on" after hiding sort column')
cell_selector = 'td.completed_on'
rows = self.find_all(row_selector)
row1_completed_on = self._get_datetime_from_cell(rows[0], cell_selector)
row2_completed_on = self._get_datetime_from_cell(rows[1], cell_selector)
self.assertTrue(row1_completed_on > row2_completed_on,
'table should be sorted by -completed_on')

View File

@@ -27,7 +27,10 @@ from bldcontrol import bbcontroller
from django.http import HttpResponse, JsonResponse
from django.views.generic import View
from django.core.urlresolvers import reverse
from django.core import serializers
from django.utils import timezone
from django.template.defaultfilters import date
from toastergui.templatetags.projecttags import json, sectohms, get_tasks
def error_response(error):
return JsonResponse({"error": error})
@@ -84,7 +87,7 @@ class XhrBuildRequest(View):
br.save()
except BuildRequest.DoesNotExist:
return error_response('No such build id %s' % i)
return error_response('No such build request id %s' % i)
return error_response('ok')
@@ -147,7 +150,7 @@ class XhrLayer(View):
layer_version = Layer_Version.objects.get(
id=kwargs['layerversion_id'],
project=kwargs['pid'],
layer_source__sourcetype=LayerSource.TYPE_IMPORTED)
layer_source=LayerSource.TYPE_IMPORTED)
except Layer_Version.DoesNotExist:
return error_response("Cannot find imported layer to update")
@@ -159,8 +162,6 @@ class XhrLayer(View):
if "commit" in request.POST:
layer_version.commit = request.POST["commit"]
layer_version.branch = request.POST["commit"]
if "up_branch" in request.POST:
layer_version.up_branch_id = int(request.POST["up_branch"])
if "summary" in request.POST:
layer_version.layer.summary = request.POST["summary"]
if "description" in request.POST:
@@ -193,7 +194,7 @@ class XhrLayer(View):
layer_version = Layer_Version.objects.get(
id=kwargs['layerversion_id'],
project=kwargs['pid'],
layer_source__sourcetype=LayerSource.TYPE_IMPORTED)
layer_source=LayerSource.TYPE_IMPORTED)
except Layer_Version.DoesNotExist:
return error_response("Cannot find imported layer to delete")
@@ -210,3 +211,111 @@ class XhrLayer(View):
"error": "ok",
"redirect": reverse('project', args=(kwargs['pid'],))
})
class MostRecentBuildsView(View):
def _was_yesterday_or_earlier(self, completed_on):
now = timezone.now()
delta = now - completed_on
if delta.days >= 1:
return True
return False
def get(self, request, *args, **kwargs):
"""
Returns a list of builds in JSON format.
"""
mrb_type = 'all'
project = None
project_id = request.GET.get('project_id', None)
if project_id:
try:
mrb_type = 'project'
project = Project.objects.get(pk=project_id)
except:
# if project lookup fails, assume no project
pass
recent_build_objs = Build.get_recent(project)
recent_builds = []
# for timezone conversion
tz = timezone.get_current_timezone()
for build_obj in recent_build_objs:
dashboard_url = reverse('builddashboard', args=(build_obj.pk,))
buildtime_url = reverse('buildtime', args=(build_obj.pk,))
rebuild_url = \
reverse('xhr_buildrequest', args=(build_obj.project.pk,))
cancel_url = \
reverse('xhr_buildrequest', args=(build_obj.project.pk,))
build = {}
build['id'] = build_obj.pk
build['dashboard_url'] = dashboard_url
buildrequest_id = None
if hasattr(build_obj, 'buildrequest'):
buildrequest_id = build_obj.buildrequest.pk
build['buildrequest_id'] = buildrequest_id
build['recipes_parsed_percentage'] = \
int((build_obj.recipes_parsed / build_obj.recipes_to_parse) * 100)
tasks_complete_percentage = 0
if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED):
tasks_complete_percentage = 100
elif build_obj.outcome == Build.IN_PROGRESS:
tasks_complete_percentage = build_obj.completeper()
build['tasks_complete_percentage'] = tasks_complete_percentage
build['state'] = build_obj.get_state()
build['errors'] = build_obj.errors.count()
build['dashboard_errors_url'] = dashboard_url + '#errors'
build['warnings'] = build_obj.warnings.count()
build['dashboard_warnings_url'] = dashboard_url + '#warnings'
build['buildtime'] = sectohms(build_obj.timespent_seconds)
build['buildtime_url'] = buildtime_url
build['rebuild_url'] = rebuild_url
build['cancel_url'] = cancel_url
build['is_default_project_build'] = build_obj.project.is_default
build['build_targets_json'] = \
json(get_tasks(build_obj.target_set.all()))
# convert completed_on time to user's timezone
completed_on = timezone.localtime(build_obj.completed_on)
completed_on_template = '%H:%M'
if self._was_yesterday_or_earlier(completed_on):
completed_on_template = '%d/%m/%Y ' + completed_on_template
build['completed_on'] = completed_on.strftime(completed_on_template)
targets = []
target_objs = build_obj.get_sorted_target_list()
for target_obj in target_objs:
if target_obj.task:
targets.append(target_obj.target + ':' + target_obj.task)
else:
targets.append(target_obj.target)
build['targets'] = ' '.join(targets)
# abbreviated form of the full target list
abbreviated_targets = ''
num_targets = len(targets)
if num_targets > 0:
abbreviated_targets = targets[0]
if num_targets > 1:
abbreviated_targets += (' +%s' % (num_targets - 1))
build['targets_abbreviated'] = abbreviated_targets
recent_builds.append(build)
return JsonResponse(recent_builds, safe=False)

View File

@@ -109,15 +109,31 @@ class BuiltPackagesTableBase(tables.PackagesTable):
hidden=True,
orderable=True)
layer_branch_template = '''
{%if not data.recipe.layer_version.layer.local_source_dir %}
<span class="text-muted">{{data.recipe.layer_version.branch}}</span>
{% else %}
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.recipe.layer_version.layer.name}} is not in a Git repository, so there is no branch associated with it"> </span>
{% endif %}
'''
self.add_column(title="Layer branch",
field_name="recipe__layer_version__branch",
hidden=True,
static_data_name="recipe__layer_version__branch",
static_data_template=layer_branch_template,
orderable=True)
git_rev_template = '''
{% if not data.recipe.layer_version.layer.local_source_dir %}
{% with vcs_ref=data.recipe.layer_version.commit %}
{% include 'snippets/gitrev_popover.html' %}
{% endwith %}
{% else %}
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.recipe.layer_version.layer.name}} is not in a Git repository, so there is no revision associated with it"> </span>
{% endif %}
'''
self.add_column(title="Layer commit",
@@ -250,10 +266,24 @@ class BuiltRecipesTable(BuildTablesMixin):
'{% if data.pathflags %}<i>({{data.pathflags}})</i>'\
'{% endif %}'
git_branch_template = '''
{% if data.layer_version.layer.local_source_dir %}
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer_version.layer.name}} is not in a Git repository, so there is no branch associated with it"> </span>
{% else %}
<span>{{data.layer_version.branch}}</span>
{% endif %}
'''
git_rev_template = '''
{% if data.layer_version.layer.local_source_dir %}
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer_version.layer.name}} is not in a Git repository, so there is no commit associated with it"> </span>
{% else %}
{% with vcs_ref=data.layer_version.commit %}
{% include 'snippets/gitrev_popover.html' %}
{% endwith %}
{% endif %}
'''
depends_on_tmpl = '''
@@ -295,13 +325,15 @@ class BuiltRecipesTable(BuildTablesMixin):
{% endif %}{% endwith %}{% endwith %}
'''
self.add_column(title="Name",
self.add_column(title="Recipe",
field_name="name",
static_data_name='name',
orderable=True,
hideable=False,
static_data_template=recipe_name_tmpl)
self.add_column(title="Version",
hideable=False,
field_name="version")
self.add_column(title="Dependencies",
@@ -340,6 +372,8 @@ class BuiltRecipesTable(BuildTablesMixin):
self.add_column(title="Layer branch",
field_name="layer_version__branch",
static_data_name="layer_version__branch",
static_data_template=git_branch_template,
orderable=True,
hidden=True)
@@ -431,17 +465,20 @@ class BuildTasksTable(BuildTablesMixin):
self.add_column(title="Order",
static_data_name="order",
static_data_template='{{data.order}}',
hideable=False,
orderable=True)
self.add_column(title="Task",
static_data_name="task_name",
static_data_template=task_link_tmpl(
"{{data.task_name}}"),
hideable=False,
orderable=True)
self.add_column(title="Recipe",
static_data_name='recipe__name',
static_data_template=recipe_name_tmpl,
hideable=False,
orderable=True)
self.add_column(title="Recipe version",

View File

@@ -1,5 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<django-objects version="1.0">
<object pk="1" model="orm.bitbakeversion">
<field type="CharField" name="name">v2.3</field>
<field type="GitURLField" name="giturl">git://git.openembedded.org/bitbake</field>
<field type="CharField" name="dirpath">b</field>
<field type="CharField" name="branch">a</field>
</object>
<object pk="1" model="orm.release">
<field type="CharField" name="name">master</field>
<field type="CharField" name="description">master project</field>
<field to="orm.bitbake_version" name="bitbake_version">1</field>
</object>
<object pk="1" model="orm.project">
<field type="CharField" name="name">a test project</field>
<field type="CharField" name="short_description"></field>
@@ -195,8 +206,6 @@
<field to="orm.customimagerecipe" name="recipe_appends" rel="ManyToManyRel"><object pk="3"></object></field>
</object>
<object pk="1" model="orm.recipe">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">z recipe</field>
<field type="CharField" name="version">5.2</field>
@@ -212,8 +221,6 @@
<field type="BooleanField" name="is_image">False</field>
</object>
<object pk="2" model="orm.recipe">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">a recipe</field>
<field type="CharField" name="version">1.2</field>
@@ -229,8 +236,6 @@
<field type="BooleanField" name="is_image">False</field>
</object>
<object pk="3" model="orm.recipe">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">a custom recipe</field>
<field type="CharField" name="version"></field>
@@ -246,8 +251,6 @@
<field type="BooleanField" name="is_image">False</field>
</object>
<object pk="4" model="orm.recipe">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">a image recipe</field>
<field type="CharField" name="version">1.2</field>
@@ -263,8 +266,6 @@
<field type="BooleanField" name="is_image">True</field>
</object>
<object pk="5" model="orm.recipe">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">z image recipe</field>
<field type="CharField" name="version">1.3</field>
@@ -280,8 +281,6 @@
<field type="BooleanField" name="is_image">True</field>
</object>
<object pk="6" model="orm.recipe">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">z custom recipe</field>
<field type="CharField" name="version"></field>
@@ -307,34 +306,23 @@
</object>
<object pk="1" model="orm.machine">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
<field type="CharField" name="name">a machine</field>
<field type="CharField" name="description">a machine</field>
</object>
<object pk="2" model="orm.machine">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">2</field>
<field type="CharField" name="name">z machine</field>
<field type="CharField" name="description">z machine</field>
</object>
<object pk="3" model="orm.machine">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.layer_version" name="layer_version" rel="ManyToOneRel">1</field>
<field type="CharField" name="name">g machine</field>
<field type="CharField" name="description">g machine</field>
</object>
<object pk="1" model="orm.layersource">
<field type="CharField" name="name">local</field>
<field type="IntegerField" name="sourcetype">1</field>
<field type="CharField" name="apiurl"></field>
</object>
<object pk="1" model="orm.bitbakeversion">
<field type="CharField" name="name">test bbv</field>
<field type="CharField" name="giturl">/tmp/</field>
@@ -355,26 +343,12 @@
<field type="CharField" name="branch_name">master</field>
<field type="TextField" name="helptext"><None></None></field>
</object>
<object pk="1" model="orm.releaselayersourcepriority">
<field to="orm.release" name="release" rel="ManyToOneRel">1</field>
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="priority">0</field>
</object>
<object pk="1" model="orm.branch">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="CharField" name="name">master</field>
<field type="CharField" name="short_description"></field>
</object>
<object pk="1" model="orm.layer">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel"><None></None></field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">a layer</field>
<field type="CharField" name="vcs_url">/tmp/</field>
</object>
<object pk="2" model="orm.layer">
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field type="CharField" name="name">z layer</field>
<field type="CharField" name="layer_index_url"></field>
@@ -383,10 +357,8 @@
<object pk="1" model="orm.layer_version">
<field to="orm.build" name="build" rel="ManyToOneRel">1</field>
<field to="orm.layer" name="layer" rel="ManyToOneRel">1</field>
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
<field to="orm.release" name="release" rel="ManyToOneRel">1</field>
<field type="CharField" name="branch">master</field>
<field type="CharField" name="commit">abcdef123</field>
<field type="CharField" name="dirpath">/tmp/</field>
@@ -397,10 +369,8 @@
<object pk="2" model="orm.layer_version">
<field to="orm.build" name="build" rel="ManyToOneRel"><None></None></field>
<field to="orm.layer" name="layer" rel="ManyToOneRel">2</field>
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
<field to="orm.release" name="release" rel="ManyToOneRel">1</field>
<field type="CharField" name="branch">testing-branch</field>
<field type="CharField" name="commit">9876fedcba</field>
<field type="CharField" name="dirpath"><None></None></field>
@@ -411,10 +381,8 @@
<object pk="3" model="orm.layer_version">
<field to="orm.build" name="build" rel="ManyToOneRel">1</field>
<field to="orm.layer" name="layer" rel="ManyToOneRel">2</field>
<field to="orm.layersource" name="layer_source" rel="ManyToOneRel">1</field>
<field type="IntegerField" name="up_id"><None></None></field>
<field type="DateTimeField" name="up_date"><None></None></field>
<field to="orm.branch" name="up_branch" rel="ManyToOneRel">1</field>
<field to="orm.release" name="release" rel="ManyToOneRel">1</field>
<field type="CharField" name="branch">testing-branch</field>
<field type="CharField" name="commit">9876fedcba</field>
<field type="CharField" name="dirpath"><None></None></field>

View File

@@ -45,6 +45,7 @@ img.logo { height: 30px; vertical-align: bottom; }
.alert-link.build-warnings,
.glyphicon-warning-sign.build-warnings { color: #8a6d3b; }
.build-result .project-name { margin-top: -10px; margin-bottom: 5px; }
.rebuild-btn, .cancel-build-btn { cursor: pointer; }
/* Styles for the help information */
.get-help { color: #CCCCCC; }
@@ -195,17 +196,22 @@ h2 { margin-bottom: 25px; }
.tt-suggestion:active { background-color: #f5f5f5; cursor: pointer; }
/* Style the import layer form controls*/
legend { border: none; }
legend { border: none; margin-top: 20px; }
.radioLegend { margin-bottom: 0; }
#layer-name-ctrl { margin-top: 20px; }
#import-layer-name,
#layer-subdir { width: 20%; }
#layer-git-repo-url { width: 40%; }
#layer-git-ref { width: 32%; }
#local-dir-path { width: 45%; }
#layer-dependency { width: 16em; }
#layer-deps-list { margin-top: 0; }
#form-actions { margin-bottom: 30px; }
#duplicate-layer-info dl { margin-top: 10px; }
#duplicate-layer-info dd { margin-bottom: 10px; }
.help-inline { color: #737373; margin-left: 10px; }
.radio-help { width: 50%; margin-left: 20px; }
#repo-select div:nth-of-type(2) { margin-top: 15px; }
/* Give some padding to the in-cell tooltips we use for notifications in tables */
td > .tooltip-inner,
@@ -249,6 +255,18 @@ code { color: #333; background-color: transparent; }
/* Style the special no results message in the custom image details page */
[id^="no-results-special-"] > .alert-warning > ol { margin-top: 10px; }
/* style the loading spinner in the new custom image dialog */
#create-new-custom-image-btn [data-role="loading-state"] {
padding-left: 16px;
}
/* icon has to be absolutely positioned, otherwise the spin animation doesn't work */
#create-new-custom-image-btn [data-role="loading-state"] .icon-spinner {
position: absolute;
left: 26px;
bottom: 26px;
}
/* Style the content of modal dialogs */
.modal-footer { text-align: left; }
.date-filter-controls { margin-top: 10px; }

View File

@@ -10,6 +10,7 @@ function importLayerPageInit (ctx) {
var layerDepInput = $("#layer-dependency");
var layerNameCtrl = $("#layer-name-ctrl");
var duplicatedLayerName = $("#duplicated-layer-name-hint");
var localDirPath = $("#local-dir-path");
var layerDeps = {};
var layerDepsDeps = {};
@@ -35,6 +36,9 @@ function importLayerPageInit (ctx) {
}
});
// Disable local dir repo when page is loaded.
$('#local-dir').hide();
// disable the "Add layer" button when the layer input typeahead is empty
// or not in the typeahead choices
layerDepInput.on("input change", function () {
@@ -168,8 +172,16 @@ function importLayerPageInit (ctx) {
dir_path: $("#layer-subdir").val(),
project_id: libtoaster.ctx.projectId,
layer_deps: layerDepsCsv,
local_source_dir: $('#local-dir-path').val(),
};
if ($('input[name=repo]:checked').val() == "git") {
layerData.local_source_dir = "";
} else {
layerData.vcs_url = "";
layerData.git_ref = "";
}
$.ajax({
type: "POST",
url: ctx.xhrImportLayerUrl,
@@ -208,25 +220,45 @@ function importLayerPageInit (ctx) {
function check_form() {
var valid = false;
var inputs = $("input:required");
var inputStr = inputs.val().split("");
for (var i=0; i<inputs.length; i++){
if (!(valid = inputs[i].value)){
for (var i=0; i<inputs.val().length; i++){
if (!(valid = inputStr[i])){
enable_import_btn(false);
break;
}
}
if (valid)
enable_import_btn(true);
if (valid) {
if ($("#local-dir-radio").prop("checked") && localDirPath.val().length > 0) {
enable_import_btn(true);
}
if ($("#git-repo-radio").prop("checked") && vcsURLInput.val().length > 0 && gitRefInput.val().length > 0) {
enable_import_btn(true);
}
}
if (inputs.val().length == 0)
enable_import_btn(false);
}
function layerExistsError(layer){
var dupLayerInfo = $("#duplicate-layer-info");
dupLayerInfo.find(".dup-layer-name").text(layer.name);
dupLayerInfo.find(".dup-layer-link").attr("href", layer.layerdetailurl);
dupLayerInfo.find("#dup-layer-vcs-url").text(layer.vcs_url);
dupLayerInfo.find("#dup-layer-revision").text(layer.vcs_reference);
if (layer.local_source_dir) {
$("#git-layer-dup").hide();
$("#local-layer-dup").fadeIn();
dupLayerInfo.find(".dup-layer-name").text(layer.name);
dupLayerInfo.find(".dup-layer-link").attr("href", layer.layerdetailurl);
dupLayerInfo.find("#dup-local-source-dir-name").text(layer.local_source_dir);
} else {
$("#git-layer-dup").fadeIn();
$("#local-layer-dup").hide();
dupLayerInfo.find(".dup-layer-name").text(layer.name);
dupLayerInfo.find(".dup-layer-link").attr("href", layer.layerdetailurl);
dupLayerInfo.find("#dup-layer-vcs-url").text(layer.vcs_url);
dupLayerInfo.find("#dup-layer-revision").text(layer.vcs_reference);
}
$(".fields-apart-from-layer-name").fadeOut(function(){
dupLayerInfo.fadeIn();
@@ -271,10 +303,13 @@ function importLayerPageInit (ctx) {
if ($("#duplicate-layer-info").css("display") != "None"){
$("#duplicate-layer-info").fadeOut(function(){
$(".fields-apart-from-layer-name").show();
});
$(".fields-apart-from-layer-name").show();
radioDisplay();
});
}
}
radioDisplay();
/* Don't remove the error class if we're displaying the error for another
* reason.
@@ -301,4 +336,72 @@ function importLayerPageInit (ctx) {
}
});
function radioDisplay() {
if ($('input[name=repo]:checked').val() == "local") {
$('#git-repo').hide();
$('#import-git-layer-and-add-hint').hide();
$('#local-dir').fadeIn();
$('#import-local-dir-and-add-hint').fadeIn();
} else {
$('#local-dir').hide();
$('#import-local-dir-and-add-hint').hide();
$('#git-repo').fadeIn();
$('#import-git-layer-and-add-hint').fadeIn();
}
}
$('input:radio[name="repo"]').change(function() {
radioDisplay();
if ($("#local-dir-radio").prop("checked")) {
if (localDirPath.val().length > 0) {
enable_import_btn(true);
} else {
enable_import_btn(false);
}
}
if ($("#git-repo-radio").prop("checked")) {
if (vcsURLInput.val().length > 0 && gitRefInput.val().length > 0) {
enable_import_btn(true);
} else {
enable_import_btn(false);
}
}
});
localDirPath.on('input', function(){
if ($(this).val().trim().length == 0) {
$('#import-and-add-btn').attr("disabled","disabled");
$('#local-dir').addClass('has-error');
$('#hintError-dir-abs-path').show();
$('#hintError-dir-path-starts-with-slash').show();
} else {
var input = $(this);
var reBeginWithSlash = /^\//;
var reCheckVariable = /^\$/;
var re = /([ <>\\|":\.%\?\*]+)/;
var invalidDir = re.test(input.val());
var invalidSlash = reBeginWithSlash.test(input.val());
var invalidVar = reCheckVariable.test(input.val());
if (!invalidSlash && !invalidVar) {
$('#local-dir').addClass('has-error');
$('#import-and-add-btn').attr("disabled","disabled");
$('#hintError-dir-abs-path').show();
$('#hintError-dir-path-starts-with-slash').show();
} else if (invalidDir) {
$('#local-dir').addClass('has-error');
$('#import-and-add-btn').attr("disabled","disabled");
$('#hintError-dir-path').show();
} else {
$('#local-dir').removeClass('has-error');
if (layerNameInput.val().length > 0) {
$('#import-and-add-btn').removeAttr("disabled");
}
$('#hintError-dir-abs-path').hide();
$('#hintError-dir-path-starts-with-slash').hide();
$('#hintError-dir-path').hide();
}
}
});
}

File diff suppressed because one or more lines are too long

View File

@@ -366,7 +366,7 @@ function layerDetailsPageInit (ctx) {
if ($(this).is("dt")) {
var dd = $(this).next("dd");
if (!dd.children("form:visible")|| !dd.find(".current-value").html()){
if (ctx.layerVersion.sourceId == 3){
if (ctx.layerVersion.layer_source == ctx.layerSourceTypes.TYPE_IMPORTED){
/* There's no current value and the layer is editable
* so show the "Not set" and hide the delete icon
*/

View File

@@ -148,6 +148,21 @@ var libtoaster = (function () {
});
}
function _getMostRecentBuilds(url, onsuccess, onfail) {
$.ajax({
url: url,
type: 'GET',
data : {format: 'json'},
headers: {'X-CSRFToken': $.cookie('csrftoken')},
success: function (data) {
onsuccess ? onsuccess(data) : console.log(data);
},
error: function (data) {
onfail ? onfail(data) : console.error(data);
}
});
}
/* Get a project's configuration info */
function _getProjectInfo(url, onsuccess, onfail){
$.ajax({
@@ -421,11 +436,27 @@ var libtoaster = (function () {
});
}
// if true, the loading spinner for Ajax requests will be displayed
// if requests take more than 1200ms
var ajaxLoadingTimerEnabled = true;
// turn on the page-level loading spinner for Ajax requests
function _enableAjaxLoadingTimer() {
ajaxLoadingTimerEnabled = true;
}
// turn off the page-level loading spinner for Ajax requests
function _disableAjaxLoadingTimer() {
ajaxLoadingTimerEnabled = false;
}
return {
enableAjaxLoadingTimer: _enableAjaxLoadingTimer,
disableAjaxLoadingTimer: _disableAjaxLoadingTimer,
reload_params : reload_params,
startABuild : _startABuild,
cancelABuild : _cancelABuild,
getMostRecentBuilds: _getMostRecentBuilds,
makeTypeahead : _makeTypeahead,
getProjectInfo: _getProjectInfo,
getLayerDepsForProject : _getLayerDepsForProject,
@@ -469,7 +500,6 @@ function reload_params(params) {
window.location.href = url+"?"+callparams.join('&');
}
/* Things that happen for all pages */
$(document).ready(function() {
@@ -628,7 +658,9 @@ $(document).ready(function() {
window.clearTimeout(ajaxLoadingTimer);
ajaxLoadingTimer = window.setTimeout(function() {
$("#loading-notification").fadeIn();
if (libtoaster.ajaxLoadingTimerEnabled) {
$("#loading-notification").fadeIn();
}
}, 1200);
});

View File

@@ -1,33 +1,19 @@
function mrbSectionInit(ctx){
var projectBuilds;
if (ctx.mrbType === 'project')
projectBuilds = true;
$(".cancel-build-btn").click(function(e){
$('#latest-builds').on('click', '.cancel-build-btn', function(e){
e.stopImmediatePropagation();
e.preventDefault();
var url = $(this).data('request-url');
var buildReqIds = $(this).data('buildrequest-id');
var banner = $(this).parents(".alert");
banner.find(".progress-info").fadeOut().promise().done(function(){
$("#cancelling-msg-" + buildReqIds).show();
console.log("cancel build");
libtoaster.cancelABuild(url, buildReqIds, function(){
if (projectBuilds == false){
/* the all builds page is not 'self updating' like thei
* project Builds
*/
window.location.reload();
}
}, null);
});
libtoaster.cancelABuild(url, buildReqIds, function () {
window.location.reload();
}, null);
});
$(".run-again-btn").click(function(e){
$('#latest-builds').on('click', '.rebuild-btn', function(e){
e.stopImmediatePropagation();
e.preventDefault();
var url = $(this).data('request-url');
@@ -38,58 +24,112 @@ function mrbSectionInit(ctx){
}, null);
});
// cached version of buildData, so we can determine whether a build has
// changed since it was last fetched, and update the DOM appropriately
var buildData = {};
var progressTimer;
// returns the cached version of this build, or {} is there isn't a cached one
function getCached(build) {
return buildData[build.id] || {};
}
if (projectBuilds === true){
progressTimer = window.setInterval(function() {
libtoaster.getProjectInfo(libtoaster.ctx.projectPageUrl,
function(prjInfo){
/* These two are needed because a build can be 100% and still
* in progress due to the fact that the % done is updated at the
* start of a task so it can be doing the last task at 100%
*/
var inProgress = 0;
var allPercentDone = 0;
if (prjInfo.builds.length === 0)
return
// returns true if a build's state changed to "Succeeded", "Failed"
// or "Cancelled" from some other value
function buildFinished(build) {
var cached = getCached(build);
return cached.state &&
cached.state !== build.state &&
(build.state == 'Succeeded' || build.state == 'Failed' ||
build.state == 'Cancelled');
}
for (var i in prjInfo.builds){
var build = prjInfo.builds[i];
// returns true if the state changed
function stateChanged(build) {
var cached = getCached(build);
return (cached.state !== build.state);
}
if (build.outcomeText === "In Progress" ||
$(".progress .bar").length > 0){
/* Update the build progress */
var percentDone;
// returns true if the tasks_complete_percentage changed
function tasksProgressChanged(build) {
var cached = getCached(build);
return (cached.tasks_complete_percentage !== build.tasks_complete_percentage);
}
if (build.outcomeText !== "In Progress"){
/* We have to ignore the value when it's Succeeded because it
* goes back to 0
*/
percentDone = 100;
} else {
percentDone = build.percentDone;
inProgress++;
}
// returns true if the number of recipes parsed/to parse changed
function recipeProgressChanged(build) {
var cached = getCached(build);
return (cached.recipes_parsed_percentage !== build.recipes_parsed_percentage);
}
$("#build-pc-done-" + build.id).text(percentDone);
$("#build-pc-done-title-" + build.id).attr("title", percentDone);
$("#build-pc-done-bar-" + build.id).css("width",
String(percentDone) + "%");
function refreshMostRecentBuilds(){
libtoaster.getMostRecentBuilds(
libtoaster.ctx.mostRecentBuildsUrl,
allPercentDone += percentDone;
}
// success callback
function (data) {
var build;
var tmpl;
var container;
var selector;
var colourClass;
var elements;
for (var i = 0; i < data.length; i++) {
build = data[i];
if (buildFinished(build)) {
// a build finished: reload the whole page so that the build
// shows up in the builds table
window.location.reload();
}
else if (stateChanged(build)) {
// update the whole template
build.warnings_pluralise = (build.warnings !== 1 ? 's' : '');
build.errors_pluralise = (build.errors !== 1 ? 's' : '');
tmpl = $.templates("#build-template");
html = $(tmpl.render(build));
selector = '[data-latest-build-result="' + build.id + '"] ' +
'[data-role="build-status-container"]';
container = $(selector);
// initialize bootstrap tooltips in the new HTML
html.find('span.glyphicon-question-sign').tooltip();
container.html(html);
}
else if (tasksProgressChanged(build)) {
// update the task progress text
selector = '#build-pc-done-' + build.id;
$(selector).html(build.tasks_complete_percentage);
// update the task progress bar
selector = '#build-pc-done-bar-' + build.id;
$(selector).width(build.tasks_complete_percentage + '%');
}
else if (recipeProgressChanged(build)) {
// update the recipe progress text
selector = '#recipes-parsed-percentage-' + build.id;
$(selector).html(build.recipes_parsed_percentage);
// update the recipe progress bar
selector = '#recipes-parsed-percentage-bar-' + build.id;
$(selector).width(build.recipes_parsed_percentage + '%');
}
if (allPercentDone === (100 * prjInfo.builds.length) && !inProgress)
window.location.reload();
buildData[build.id] = build;
}
},
/* Our progress bar is not still showing so shutdown the polling. */
if ($(".progress .bar").length === 0)
window.clearInterval(progressTimer);
});
}, 1500);
// fail callback
function (data) {
console.error(data);
}
);
}
}
window.setInterval(refreshMostRecentBuilds, 1500);
refreshMostRecentBuilds();
}

View File

@@ -25,7 +25,11 @@ function newCustomImageModalInit(){
var duplicateNameMsg = "An image with this name already exists. Image names must be unique.";
var duplicateImageInProjectMsg = "An image with this name already exists in this project."
var invalidBaseRecipeIdMsg = "Please select an image to customise.";
// set button to "submit" state and enable text entry so user can
// enter the custom recipe name
showSubmitState();
/* capture clicks on radio buttons inside the modal; when one is selected,
* set the recipe on the modal
*/
@@ -40,6 +44,9 @@ function newCustomImageModalInit(){
});
newCustomImgBtn.click(function(e){
// disable the button and text entry
showLoadingState();
e.preventDefault();
var baseRecipeId = imgCustomModal.data('recipe');
@@ -69,12 +76,33 @@ function newCustomImageModalInit(){
}
} else {
imgCustomModal.modal('hide');
imgCustomModal.one('hidden.bs.modal', showSubmitState);
window.location.replace(ret.url + '?notify=new');
}
});
}
});
// enable text entry, show "Create image" button text
function showSubmitState() {
libtoaster.enableAjaxLoadingTimer();
newCustomImgBtn.find('[data-role="loading-state"]').hide();
newCustomImgBtn.find('[data-role="submit-state"]').show();
newCustomImgBtn.removeAttr('disabled');
nameInput.removeAttr('disabled');
}
// disable text entry, show "Creating image..." button text;
// we also disabled the page-level ajax loading spinner while this spinner
// is active
function showLoadingState() {
libtoaster.disableAjaxLoadingTimer();
newCustomImgBtn.find('[data-role="submit-state"]').hide();
newCustomImgBtn.find('[data-role="loading-state"]').show();
newCustomImgBtn.attr('disabled', 'disabled');
nameInput.attr('disabled', 'disabled');
}
function showNameError(text){
invalidNameHelp.text(text);
invalidNameHelp.show();
@@ -167,6 +195,5 @@ function newCustomImageModalSetRecipes(baseRecipes) {
// show the radio button container
imageSelector.show();
}
}
}

View File

@@ -172,7 +172,12 @@ function projectPageInit(ctx) {
link.attr("href", layerObj.layerdetailurl);
link.text(layerObj.name);
link.tooltip({title: layerObj.vcs_url + " | "+ layerObj.vcs_reference, placement: "right"});
if (layerObj.local_source_dir) {
link.tooltip({title: layerObj.local_source_dir, placement: "right"});
} else {
link.tooltip({title: layerObj.vcs_url + " | "+ layerObj.vcs_reference, placement: "right"});
}
var trashItem = projectLayer.children("span");
trashItem.click(function (e) {

View File

@@ -15,6 +15,7 @@ function tableInit(ctx){
orderby : null,
filter : null,
search : null,
default_orderby: null,
};
var defaultHiddenCols = [];
@@ -192,6 +193,8 @@ function tableInit(ctx){
tableHeadRow.html("");
editColMenu.html("");
tableParams.default_orderby = tableData.default_orderby;
if (!tableParams.orderby && tableData.default_orderby){
tableParams.orderby = tableData.default_orderby;
}
@@ -217,6 +220,7 @@ function tableInit(ctx){
var title = $('<a href=\"#\" ></a>');
title.data('field-name', col.field_name);
title.attr('data-sort-field', col.field_name);
title.text(col.title);
title.click(sortColumnClicked);
@@ -344,29 +348,65 @@ function tableInit(ctx){
}
}
/* Apply an ordering to the current table.
*
* 1. Find the column heading matching the sortSpecifier
* 2. Set its up/down arrow and add .sorted
*
* orderby: e.g. "-started_on", "completed_on"
* colHeading: column heading element to activate (by showing the caret
* up/down, depending on sort order); if not set, the correct column
* heading is selected from the DOM using orderby as a key
*/
function applyOrderby(orderby, colHeading) {
if (!orderby) {
return;
}
// We only have one sort at a time so remove existing sort indicators
$("#" + ctx.tableName + " th .icon-caret-down").hide();
$("#" + ctx.tableName + " th .icon-caret-up").hide();
$("#" + ctx.tableName + " th a").removeClass("sorted");
// normalise the orderby so we can use it to find the link we want
// to style
var fieldName = orderby;
if (fieldName.indexOf('-') === 0) {
fieldName = fieldName.slice(1);
}
// find the table header element which corresponds to the sort field
// (if we don't already have it)
if (!colHeading) {
colHeading = $('[data-sort-field="' + fieldName + '"]');
}
colHeading.addClass("sorted");
var parent = colHeading.parent();
if (orderby.indexOf('-') === 0) {
parent.children('.icon-caret-up').show();
}
else {
parent.children('.icon-caret-down').show();
}
tableParams.orderby = orderby;
loadData(tableParams);
}
function sortColumnClicked(e){
e.preventDefault();
/* We only have one sort at a time so remove any existing sort indicators */
$("#"+ctx.tableName+" th .icon-caret-down").hide();
$("#"+ctx.tableName+" th .icon-caret-up").hide();
$("#"+ctx.tableName+" th a").removeClass("sorted");
var fieldName = $(this).data('field-name');
/* if we're already sorted sort the other way */
if (tableParams.orderby === fieldName &&
var orderby = $(this).data('field-name');
if (tableParams.orderby === orderby &&
tableParams.orderby.indexOf('-') === -1) {
tableParams.orderby = '-' + $(this).data('field-name');
$(this).parent().children('.icon-caret-up').show();
} else {
tableParams.orderby = $(this).data('field-name');
$(this).parent().children('.icon-caret-down').show();
orderby = '-' + orderby;
}
$(this).addClass("sorted");
loadData(tableParams);
applyOrderby(orderby, $(this));
}
function pageButtonClicked(e) {
@@ -385,11 +425,13 @@ function tableInit(ctx){
table.find("."+col).show();
} else {
table.find("."+col).hide();
/* If we're ordered by the column we're hiding remove the order by */
// If we're ordered by the column we're hiding remove the order by
// and apply the default one instead
if (col === tableParams.orderby ||
'-' + col === tableParams.orderby){
tableParams.orderby = null;
$("#"+ctx.tableName +" .default-orderby").click();
applyOrderby(tableParams.default_orderby);
}
}

View File

@@ -114,8 +114,12 @@ class LayersTable(ToasterTable):
git_url_template = '''
<a href="{% url 'layerdetails' extra.pid data.id %}">
{% if data.layer.local_source_dir %}
<code>{{data.layer.local_source_dir}}</code>
{% else %}
<code>{{data.layer.vcs_url}}</code>
</a>
{% endif %}
{% if data.get_vcs_link_url %}
<a target="_blank" href="{{ data.get_vcs_link_url }}">
<span class="glyphicon glyphicon-new-window"></span>
@@ -123,16 +127,21 @@ class LayersTable(ToasterTable):
{% endif %}
'''
self.add_column(title="Git repository URL",
help_text="The Git repository for the layer source code",
self.add_column(title="Layer source code location",
help_text="A Git repository or an absolute path to a directory",
hidden=True,
static_data_name="layer__vcs_url",
static_data_template=git_url_template)
git_dir_template = '''
{% if data.layer.local_source_dir %}
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer.name}} is not in a Git repository, so there is no subdirectory associated with it"> </span>
{% else %}
<a href="{% url 'layerdetails' extra.pid data.id %}">
<code>{{data.dirpath}}</code>
</a>
{% endif %}
{% if data.dirpath and data.get_vcs_dirpath_link_url %}
<a target="_blank" href="{{ data.get_vcs_dirpath_link_url }}">
<span class="glyphicon glyphicon-new-window"></span>
@@ -146,9 +155,14 @@ class LayersTable(ToasterTable):
static_data_template=git_dir_template)
revision_template = '''
{% if data.layer.local_source_dir %}
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer.name}} is not in a Git repository, so there is no revision associated with it"> </span>
{% else %}
{% with vcs_ref=data.get_vcs_reference %}
{% include 'snippets/gitrev_popover.html' %}
{% endwith %}
{% endif %}
'''
self.add_column(title="Git revision",
@@ -413,9 +427,19 @@ class RecipesTable(ToasterTable):
orderable=True,
field_name="license")
revision_link_template = '''
{% if data.layer_version.layer.local_source_dir %}
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{data.layer_version.layer.name}} is not in a Git repository, so there is no revision associated with it"> </span>
{% else %}
{{data.layer_version.get_vcs_reference}}
{% endif %}
'''
self.add_column(title="Git revision",
hidden=True,
field_name="layer_version__get_vcs_reference")
static_data_name="layer_version__get_vcs_reference",
static_data_template=revision_link_template)
class LayerRecipesTable(RecipesTable):
@@ -1197,9 +1221,13 @@ class BuildsTable(ToasterTable):
time_template = '''
{% load projecttags %}
<a href="{% url "buildtime" data.id %}">
{% if data.outcome == extra.Build.SUCCEEDED %}
<a href="{% url "buildtime" data.id %}">
{{data.timespent_seconds | sectohms}}
</a>
{% else %}
{{data.timespent_seconds | sectohms}}
</a>
{% endif %}
'''
image_files_template = '''

View File

@@ -22,6 +22,8 @@
</script>
<script src="{% static 'js/typeahead.jquery.js' %}">
</script>
<script src="{% static 'js/jsrender.min.js' %}">
</script>
<script src="{% static 'js/prettify.js' %}">
</script>
<script src="{% static 'js/libtoaster.js' %}">
@@ -32,6 +34,8 @@
</script>
{% endif %}
<script>
$.views.settings.delimiters("<%", "%>");
libtoaster.ctx = {
jsUrl : "{% static 'js/' %}",
htmlUrl : "{% static 'html/' %}",
@@ -48,7 +52,9 @@
xhrCustomRecipeUrl : "{% url 'xhr_customrecipe' %}",
projectId : {{project.id}},
xhrBuildRequestUrl: "{% url 'xhr_buildrequest' project.id %}",
mostRecentBuildsUrl: "{% url 'most_recent_builds' %}?project_id={{project.id}}",
{% else %}
mostRecentBuildsUrl: "{% url 'most_recent_builds' %}",
projectId : undefined,
projectPageUrl : undefined,
projectName : undefined,

View File

@@ -52,104 +52,106 @@
</div>
</div>
<div class="row">
<!-- begin left sidebar container -->
<div id="nav" class="col-md-2">
<ul class="nav nav-pills nav-stacked" id="build-menu">
<li
{% if request.resolver_match.url_name == 'builddashboard' %}
class="active"
{% endif %} >
<a href="{% url 'builddashboard' build.pk %}">Build summary</a>
</li>
{% if build.has_images and build.outcome == build.SUCCEEDED %}
<li class="nav-header" data-menu-heading="images">Images</li>
{% block nav-target %}
{% for t in build.get_sorted_target_list %}
{% if t.has_images %}
<li id="menu-{{t.target}}"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
{% endif %}
{% endfor %}
{% endblock %}
{% endif %}
<li class="nav-header">Build</li>
<li id="menu-configuration"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
<li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
<li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
<li><a href="{% url 'packages' build.pk %}">Packages</a></li>
<li class="nav-header">Performance</li>
<li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
<li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li>
<li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
<!-- begin left sidebar container for builds which started properly -->
{% if build.started %}
<div class="row">
<div id="nav" class="col-md-2">
<ul class="nav nav-pills nav-stacked" id="build-menu">
<li
{% if request.resolver_match.url_name == 'builddashboard' %}
class="active"
{% endif %} >
<a href="{% url 'builddashboard' build.pk %}">Build summary</a>
</li>
{% if build.has_images and build.outcome == build.SUCCEEDED %}
<li class="nav-header" data-menu-heading="images">Images</li>
{% block nav-target %}
{% for t in build.get_sorted_target_list %}
{% if t.has_images %}
<li id="menu-{{t.target}}"><a href="{% url 'target' build.pk t.pk %}">{{t.target}}</a><li>
{% endif %}
{% endfor %}
{% endblock %}
{% endif %}
<li class="nav-header">Build</li>
<li id="menu-configuration"><a href="{% url 'configuration' build.pk %}">Configuration</a></li>
<li><a href="{% url 'tasks' build.pk %}">Tasks</a></li>
<li><a href="{% url 'recipes' build.pk %}">Recipes</a></li>
<li><a href="{% url 'packages' build.pk %}">Packages</a></li>
<li class="nav-header">Performance</li>
<li><a href="{% url 'buildtime' build.pk %}">Time</a></li>
<li><a href="{% url 'cputime' build.pk %}">CPU usage</a></li>
<li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li>
<li class="nav-header">Actions</li>
<a class="btn btn-default btn-block navbar-btn" href="{% url 'build_artifact' build.id 'cookerlog' build.id %}">Download build log</a>
<li class="nav-header">Actions</li>
<a class="btn btn-default btn-block navbar-btn" href="{% url 'build_artifact' build.id 'cookerlog' build.id %}">Download build log</a>
{% with build.get_custom_image_recipes as custom_image_recipes %}
{% if custom_image_recipes.count > 0 %}
<!-- edit custom image built during this build -->
<button class="btn btn-default btn-block navbar-btn" data-role="edit-custom-image-trigger">Edit custom image</button>
{% include 'editcustomimage_modal.html' %}
{% with build.get_custom_image_recipes as custom_image_recipes %}
{% if custom_image_recipes.count > 0 %}
<!-- edit custom image built during this build -->
<button class="btn btn-default btn-block navbar-btn" data-role="edit-custom-image-trigger">Edit custom image</button>
{% include 'editcustomimage_modal.html' %}
<script>
var editableCustomImageRecipes = {{ custom_image_recipes | objects_to_dictionaries:"id,name" | json }};
$(document).ready(function () {
var editCustomImageTrigger = $('[data-role="edit-custom-image-trigger"]');
var editCustomImageModal = $('#edit-custom-image-modal');
// edit custom image which was built during this build
editCustomImageTrigger.click(function () {
// single editable custom image: redirect to the edit page
// for that image
if (editableCustomImageRecipes.length === 1) {
var url = '{% url "customrecipe" build.project.id custom_image_recipes.first.id %}';
document.location.href = url;
}
// multiple editable custom images: show modal to select
// one of them for editing
else {
editCustomImageModal.modal('show');
}
});
});
</script>
{% endif %}
{% endwith %}
<!-- new custom image from image recipe in this build -->
{% if build.has_image_recipes %}
<button class="btn btn-default btn-block navbar-btn" data-role="new-custom-image-trigger">New custom image</button>
{% include 'newcustomimage_modal.html' %}
<script>
var editableCustomImageRecipes = {{ custom_image_recipes | objects_to_dictionaries:"id,name" | json }};
// imageRecipes includes both custom image recipes and built-in
// image recipes, any of which can be used as the basis for a
// new custom image
var imageRecipes = {{ build.get_image_recipes | objects_to_dictionaries:"id,name" | json }};
$(document).ready(function () {
var editCustomImageTrigger = $('[data-role="edit-custom-image-trigger"]');
var editCustomImageModal = $('#edit-custom-image-modal');
var newCustomImageModal = $('#new-custom-image-modal');
var newCustomImageTrigger = $('[data-role="new-custom-image-trigger"]');
// edit custom image which was built during this build
editCustomImageTrigger.click(function () {
// single editable custom image: redirect to the edit page
// for that image
if (editableCustomImageRecipes.length === 1) {
var url = '{% url "customrecipe" build.project.id custom_image_recipes.first.id %}';
document.location.href = url;
}
// multiple editable custom images: show modal to select
// one of them for editing
else {
editCustomImageModal.modal('show');
// show create new custom image modal to select an image built
// during this build as the basis for the custom recipe
newCustomImageTrigger.click(function () {
if (!imageRecipes.length) {
return;
}
newCustomImageModalSetRecipes(imageRecipes);
newCustomImageModal.modal('show');
});
});
</script>
{% endif %}
{% endwith %}
<!-- new custom image from image recipe in this build -->
{% if build.has_image_recipes %}
<button class="btn btn-default btn-block navbar-btn" data-role="new-custom-image-trigger">New custom image</button>
{% include 'newcustomimage_modal.html' %}
<script>
// imageRecipes includes both custom image recipes and built-in
// image recipes, any of which can be used as the basis for a
// new custom image
var imageRecipes = {{ build.get_image_recipes | objects_to_dictionaries:"id,name" | json }};
$(document).ready(function () {
var newCustomImageModal = $('#new-custom-image-modal');
var newCustomImageTrigger = $('[data-role="new-custom-image-trigger"]');
// show create new custom image modal to select an image built
// during this build as the basis for the custom recipe
newCustomImageTrigger.click(function () {
if (!imageRecipes.length) {
return;
}
newCustomImageModalSetRecipes(imageRecipes);
newCustomImageModal.modal('show');
});
});
</script>
{% endif %}
</ul>
{% endif %}
</ul>
</div>
<!-- end left sidebar container -->
{% endif %}
<!-- right container; need class="row" for builds without left-hand menu -->
<div{% if not build.started %} class="row"{% endif %}>
{% block buildinfomain %}{% endblock %}
</div>
<!-- end left sidebar container -->
<!-- begin right container -->
{% block buildinfomain %}{% endblock %}
<!-- end right container -->
</div>
{% endblock %}

View File

@@ -14,7 +14,7 @@
{% block buildinfomain %}
<!-- page title -->
<div class="col-md-10">
<div class="{% if build.started %}col-md-10{% else %}col-md-12{% endif %}">
<div class="page-header build-data">
<h1>{{build.get_sorted_target_list|field_values:"target"|join:", "}} {{build.machine}}</h1>
</div>
@@ -38,8 +38,15 @@
{% endif %}
<span class="pull-right">
Build time:
<a class="alert-link" href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
</span>
<span data-build-field="buildtime">
{% if build.outcome == build.SUCCEEDED %}
<a href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}</a>
{% else %}
{{ build.timespent_seconds|sectohms }}
{% endif %}
</span>
</span>
{%endif%}
</div>
@@ -55,9 +62,9 @@
</div>
<div class="panel-collapse collapse in" id="error-info">
<div class="panel-body">
<div class="col-md-10">
<div class="{% if build.started %}col-md-10{% else %}col-md-12{% endif %}">
{% for error in build.errors %}
<div class="alert alert-danger" data-error="{{ error.id }}">
<div class="alert alert-danger" data-log-message-id="{{error.pk}}">
<pre>{{error.message}}</pre>
</div>
{% endfor %}
@@ -194,79 +201,82 @@
</div>
{% endif %}
<!-- build summary -->
<h2>Build summary</h2>
<div class="row">
<div class="col-md-4 dashboard-section">
<div class="well well-transparent">
<h3><a href="{%url 'configuration' build.pk%}">Configuration</a></h3>
<dl>
<dt>Machine</dt><dd>{{build.machine}}</dd>
<dt>Distro</dt><dd>{{build.distro}}</dd>
<dt>Layers</dt><dd><ul class="list-unstyled">{% for i in build.layer_version_build.all|dictsort:"layer.name" %}<li>{{i.layer.name}}</li>{%endfor%}</ul></dd>
</dl>
</div>
</div>
<div class="col-md-4 dashboard-section">
<div class="well well-transparent">
<h3><a href="{%url 'tasks' build.pk%}">Tasks</a></h3>
<dl>
{% query build.task_build outcome=4 order__gt=0 as exectask%}
{% if exectask.count > 0 %}
<dt>Failed tasks</dt>
<dd>
{% if exectask.count == 1 %}
<a class="text-danger" href="{% url "task" build.id exectask.0.id %}">
{{exectask.0.recipe.name}}
<span class="task-name">{{exectask.0.task_name}}</span>
</a>
<a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
<span class="glyphicon glyphicon-download-alt get-help" title="Download task log file"></i>
</a>
{% elif exectask.count > 1%}
<a class="text-danger" href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}}</a>
{% endif %}
</dd>
{% endif %}
<dt>Total number of tasks</dt><dd><a href="{% url 'tasks' build.pk %}">{% query build.task_build order__gt=0 as alltasks %}{{alltasks.count}}</a></dd>
<dt>
Tasks executed
<span class="glyphicon glyphicon-question-sign get-help" title="'Executed' tasks are those that need to be run in order to generate the task output"></span>
</dt>
<dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A1&amp;count=25&amp;search=&amp;page=1&amp;orderby=order%3A%2B">{% query build.task_build task_executed=1 order__gt=0 as exectask%}{{exectask.count}}</a></dd>
<dt>
Tasks not executed
<span class="glyphicon glyphicon-question-sign get-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></span>
</dt>
<dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A0&amp;count=25&amp;search=&amp;page=1&amp;orderby=order%3A%2B">{% query build.task_build task_executed=0 order__gt=0 as noexectask%}{{noexectask.count}}</a></dd>
<dt>
Reuse
<span class="glyphicon glyphicon-question-sign get-help" title="The percentage of 'not executed' tasks over the total number of tasks, which is a measure of the efficiency of your build"></span>
</dt>
<dd>
{% query build.task_build order__gt=0 as texec %}
{% if noexectask.count|multiply:100|divide:texec.count < 0 %}
0
{% else %}
{{noexectask.count|multiply:100|divide:texec.count}}
{% endif %}
%
</dd>
</dl>
{% if build.started %}
<!-- build summary -->
<h2 data-role="build-summary-heading">Build summary</h2>
<div class="row">
<div class="col-md-4 dashboard-section">
<div class="well well-transparent">
<h3><a href="{%url 'configuration' build.pk%}">Configuration</a></h3>
<dl>
<dt>Machine</dt><dd>{{build.machine}}</dd>
<dt>Distro</dt><dd>{{build.distro}}</dd>
<dt>Layers</dt><dd><ul class="list-unstyled">{% for i in build.layer_version_build.all|dictsort:"layer.name" %}<li>{{i.layer.name}}</li>{%endfor%}</ul></dd>
</dl>
</div>
</div>
<div class="col-md-4 dashboard-section">
<div class="well well-transparent">
<h3><a href="{%url 'tasks' build.pk%}">Tasks</a></h3>
<dl>
{% query build.task_build outcome=4 order__gt=0 as exectask%}
{% if exectask.count > 0 %}
<dt>Failed tasks</dt>
<dd>
{% if exectask.count == 1 %}
<a class="text-danger" href="{% url "task" build.id exectask.0.id %}">
{{exectask.0.recipe.name}}
<span class="task-name">{{exectask.0.task_name}}</span>
</a>
<a href="{% url 'build_artifact' build.id "tasklogfile" exectask.0.id %}">
<span class="glyphicon glyphicon-download-alt get-help" title="Download task log file"></i>
</a>
{% elif exectask.count > 1%}
<a class="text-danger" href="{% url "tasks" build.id %}?filter=outcome%3A4">{{exectask.count}}</a>
{% endif %}
</dd>
{% endif %}
<dt>Total number of tasks</dt><dd><a href="{% url 'tasks' build.pk %}">{% query build.task_build order__gt=0 as alltasks %}{{alltasks.count}}</a></dd>
<dt>
Tasks executed
<span class="glyphicon glyphicon-question-sign get-help" title="'Executed' tasks are those that need to be run in order to generate the task output"></span>
</dt>
<dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A1&amp;count=25&amp;search=&amp;page=1&amp;orderby=order%3A%2B">{% query build.task_build task_executed=1 order__gt=0 as exectask%}{{exectask.count}}</a></dd>
<dt>
Tasks not executed
<span class="glyphicon glyphicon-question-sign get-help" title="'Not executed' tasks don't need to run because their outcome is provided by another task"></span>
</dt>
<dd><a href="{% url 'tasks' build.pk %}?filter=task_executed%3A0&amp;count=25&amp;search=&amp;page=1&amp;orderby=order%3A%2B">{% query build.task_build task_executed=0 order__gt=0 as noexectask%}{{noexectask.count}}</a></dd>
<dt>
Reuse
<span class="glyphicon glyphicon-question-sign get-help" title="The percentage of 'not executed' tasks over the total number of tasks, which is a measure of the efficiency of your build"></span>
</dt>
<dd>
{% query build.task_build order__gt=0 as texec %}
{% if noexectask.count|multiply:100|divide:texec.count < 0 %}
0
{% else %}
{{noexectask.count|multiply:100|divide:texec.count}}
{% endif %}
%
</dd>
</dl>
</div>
</div>
<div class="col-md-4 dashboard-section">
<div class="well well-transparent">
<h3><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h3>
<dl>
<dt>Recipes built</dt><dd><a href="{% url 'recipes' build.pk %}">{{recipecount}}</a></dd>
<dt>Packages built</dt><dd><a href="{% url 'packages' build.pk %}">{{packagecount}}</a></dd>
</dl>
</div>
</div>
<div class="col-md-4 dashboard-section">
<div class="well well-transparent">
<h3><a href="{% url 'recipes' build.pk %}">Recipes</a> & <a href="{% url 'packages' build.pk %}">Packages</a></h3>
<dl>
<dt>Recipes built</dt><dd><a href="{% url 'recipes' build.pk %}">{{recipecount}}</a></dd>
<dt>Packages built</dt><dd><a href="{% url 'packages' build.pk %}">{{packagecount}}</a></dd>
</dl>
</div>
</div>
</div>
{% endif %} <!-- end build summary -->
{% if build.warnings.count %}
<div class="panel panel-default" id="warnings">
@@ -278,9 +288,9 @@
</div>
<div class="panel-collapse collapse" id="warning-info">
<div class="panel-body">
<div class="col-md-10">
<div class="{% if build.started %}col-md-10{% else %}col-md-12{% endif %}">
{% for warning in logmessages %}{% if warning.level == 1 %}
<div class="alert alert-warning">
<div class="alert alert-warning" data-log-message-id="{{warning.pk}}">
<pre>{{warning.message}}</pre>
</div>
{% endif %}{% endfor %}

View File

@@ -1,64 +0,0 @@
{% extends "baseprojectpage.html" %}
{% load static %}
{% load projecttags %}
{% load humanize %}
{% block projectinfomain %}
<!-- begin content -->
<div class="row">
<!-- end left sidebar container -->
<!-- Begin right container -->
<div class="col-md-10">
<div class="page-header">
<h1>
<span data-toggle="tooltip" {%if buildrequest.brtarget_set.all.count > 1%}title="Targets: {%for target in buildrequest.brtarget_set.all%}{{target.target}} {%endfor%}"{%endif%}>{{buildrequest.brtarget_set.all.0.target}} {%if buildrequest.brtarget_set.all.count > 1%}(+ {{buildrequest.brtarget_set.all.count|add:"-1"}}){%endif%} {{buildrequest.get_machine}} </span>
</h1>
</div>
<div class="alert alert-error">
<p class="lead">
<strong>Failed</strong>
on {{ buildrequest.updated|date:'d/m/y H:i' }}
with
<i class="icon-minus-sign error" style="margin-left:6px;"></i>
<strong><a class="error accordion-toggle toggle-errors" href="#errors">
{{buildrequest.brerror_set.all.count}} error{{buildrequest.brerror_set.all.count|pluralize}}
</a></strong>
<span class="pull-right">Build time: {{buildrequest.get_duration|sectohms}}</span>
</p>
</div>
<div class="accordion" id="errors">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle error toggle-errors">
<h2>
<i class="icon-minus-sign"></i>
{{buildrequest.brerror_set.all.count}} error{{buildrequest.brerror_set.all.count|pluralize}}
</h2>
</a>
</div>
<div class="accordion-body collapse in" id="collapse-errors">
<div class="accordion-inner">
<div class="col-md-10">
{% for error in buildrequest.brerror_set.all %}
<div class="alert alert-error">
ERROR: <div class="air well"><pre>{{error.errmsg}}</pre></div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end of row -->
{%endblock%}

View File

@@ -53,11 +53,25 @@
<tbody>{% for lv in build.layer_version_build.all|dictsort:"layer.name" %}
<tr>
<td>{{lv.layer.name}}</td>
{% if lv.layer.local_source_dir %}
<td>
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{lv.layer.name}} is not in a Git repository, so there is no branch associated with it"> </span>
</td>
{% else %}
<td>{{lv.branch}}</td>
{% endif %}
{% if lv.layer.local_source_dir %}
<td>
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" data-original-title="" title="The source code of {{lv.layer.name}} is not in a Git repository, so there is no commit associated with it"> </span>
</td>
{% else %}
<td> <a class="btn btn-default" data-content="<ul class='list-unstyled'>
<li>{{lv.commit}}</li> </ul>">
{{lv.commit|truncatechars:13}}
</a></td>
{% endif %}
</tr>{% endfor %}
</tbody>
</table>

View File

@@ -26,16 +26,14 @@
</script>
<form class="col-md-11">
<span class="help-block">The layer you are importing must be compatible with <strong>{{project.release.description}}</strong>, which is the release you are using in this project.</span>
<div class="alert alert-error" id="import-error" style="display:none">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h3>&nbsp;</h3>
<p></p>
<ul></ul>
</div>
<fieldset>
<h2>Layer repository information</h2>
<span class="help-block">The layer you are importing must be compatible with <strong>{{project.release.description}}</strong>, which is the release you are using in this project.</span>
<div class="alert alert-error" id="import-error" style="display:none">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<h3>&nbsp;</h3>
<p></p>
<ul></ul>
</div>
<div class="form-group" id="layer-name-ctrl">
<label class="control-label" for="import-layer-name">
Layer name
@@ -45,82 +43,112 @@
<span class="help-block" style="display: none;" id="invalid-layer-name-hint">A valid layer name can only include letters, numbers and dashes</span>
<span class="help-inline" style="display: none;" id="duplicated-layer-name-hint"></span>
</div>
<div id="duplicate-layer-info" style="display:none">
<div class="alert alert-warning">
<h3>A layer called <a href="" class="dup-layer-link"><span class="dup-layer-name"></span></a> already exists</h3>
<p>Layer names must be unqiue. Please use a different layer name.</p>
<dl>
<dt>
The <span class="dup-layer-name"></span> repository url is
</dt>
<dd>
<span id="dup-layer-vcs-url"></span>
</dd>
<dt>
The <span class="dup-layer-name"></span> revision is
</dt>
<dd>
<span id="dup-layer-revision"></span>
</dd>
</dl>
<p><a href="" class="dup-layer-link">View the <span class="dup-layer-name"></span> layer information</a></p>
</div>
</div>
<div class="fields-apart-from-layer-name">
<div class="form-group">
<label for="layer-git-repo-url">
Git repository URL
<span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository. Currently, Toaster only supports Git repositories." ></span>
</label>
<input type="text" id="layer-git-repo-url" class="form-control" required>
</div>
<div class="form-group">
<label for="layer-subdir">
Repository subdirectory
<span class="text-muted">(optional)</span>
<span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span>
</label>
<input type="text" class="form-control" id="layer-subdir">
</div>
<div class="form-group" id="layer-revision-ctrl">
<label for="layer-git-ref">Git revision
<span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span>
</label>
<input type="text" class="form-control" id="layer-git-ref" required>
<span class="help-inline" style="diaply:none;" id="invalid-layer-revision-hint"></span>
</div>
</div>
</fieldset>
<div class="fields-apart-from-layer-name">
<fieldset>
<h2>
Layer dependencies
<small class="text-muted">(optional)</small>
<span class="glyphicon glyphicon-question-sign get-help heading-help" title="Other layers this layer depends upon"></span>
</h2>
<ul class="list-unstyled lead" id="layer-deps-list">
</ul>
<div class="form-inline">
<div class="form-group">
<input type="text" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" placeholder="Type a layer name" id="layer-dependency" class="form-control">
</div>
<button class="btn btn-default" id="add-layer-dependency-btn">
Add layer
</button>
<span class="help-inline">You can only add layers Toaster knows about</span>
</div>
</fieldset>
<div class="top-air" id="form-actions">
<button class="btn btn-primary btn-lg" data-toggle="modal" id="import-and-add-btn" data-target="#dependencies-message" disabled>Import and add to project</button>
<span class="help-inline" id="import-and-add-hint" style="vertical-align: middle;">To import a layer you need to enter a layer name, a Git repository URL and a Git revision (branch, tag or commit)</span>
<div id="duplicate-layer-info" style="display:none">
<div class="alert alert-warning">
<h3>A layer called <a href="" class="dup-layer-link"><span class="dup-layer-name"></span></a> already exists</h3>
<p>Layer names must be unqiue. Please use a different layer name.</p>
<dl id="git-layer-dup" style="display:none;">
<dt>
The <span class="dup-layer-name"></span> repository url is
</dt>
<dd>
<span id="dup-layer-vcs-url"></span>
</dd>
<dt>
The <span class="dup-layer-name"></span> revision is
</dt>
<dd>
<span id="dup-layer-revision"></span>
</dd>
</dl>
<dl id="local-layer-dup" style="display:none;">
<dt>
The <span class="dup-layer-name"></span> directory is
</dt>
<dd>
<span id="dup-local-source-dir-name"></span>
</dd>
</dl>
<p><a href="" class="dup-layer-link">View the <span class="dup-layer-name"></span> layer information</a></p>
</div>
</div>
</form>
<fieldset class="fields-apart-from-layer-name" id="repo-select">
<legend class="radioLegend">Where is the layer source code?</legend>
<div class="radio">
<label>
<input type="radio" id="git-repo-radio" name="repo" value="git" checked="checked">
In a <strong>Git repository</strong>
</label>
<p class="help-block radio-help">To build the layer Toaster must be able to access the Git repository, otherwise builds will fail. Toaster will fetch and checkout your chosen Git revision every time you start a build.</p>
</div>
<div class="radio">
<label>
<input type="radio" id="local-dir-radio" name="repo" value="local">
In a <strong>directory</strong>
</label>
<p class="help-block radio-help">Use this option for quick layer development, by simply providing the path to the layer source code.</p>
</div>
</fieldset>
<fieldset class="fields-apart-from-layer-name" id="git-repo">
<legend>Git repository information</legend>
<div class="form-group">
<label for="layer-git-repo-url">
Git repository URL
<span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository. Currently, Toaster only supports Git repositories." ></span>
</label>
<input type="text" id="layer-git-repo-url" class="form-control" required>
</div>
<div class="form-group">
<label for="layer-subdir">
Repository subdirectory
<span class="text-muted">(optional)</span>
<span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span>
</label>
<input type="text" class="form-control" id="layer-subdir">
</div>
<div class="form-group" id="layer-revision-ctrl">
<label for="layer-git-ref">
Git revision
<span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span>
</label>
<input type="text" class="form-control" id="layer-git-ref" required>
<span class="help-inline" style="diaply:none;" id="invalid-layer-revision-hint"></span>
</div>
</fieldset>
<fieldset class="fields-apart-from-layer-name" id="local-dir" style="display:none;">
<legend>Layer directory information</legend>
<label for="local-dir-path" class="control-label">Enter the absolute path to the layer directory</label>
<input type="text" class="form-control" id="local-dir-path" required/>
<p class="help-block" id="hintError-dir-path-starts-with-slash" style="display:none;">The absolute path must start with "/".</p>
<p class="help-block" id="hintError-dir-path" style="display:none;">The directory path cannot include spaces or any of these characters: . \ ? % * : | " " &lt; &gt;</p>
</fieldset>
<fieldset class="fields-apart-from-layer-name">
<legend>
Layer dependencies
<small class="text-muted">(optional)</small>
<span class="glyphicon glyphicon-question-sign get-help heading-help" title="Other layers this layer depends upon"></span>
</legend>
<ul class="list-unstyled lead" id="layer-deps-list">
</ul>
<div class="form-inline">
<div class="form-group">
<input type="text" autocomplete="off" data-minLength="1" data-autocomplete="off" data-provide="typeahead" placeholder="Type a layer name" id="layer-dependency" class="form-control">
</div>
<button class="btn btn-default" id="add-layer-dependency-btn">
Add layer
</button>
<span class="help-inline">You can only add layers Toaster knows about</span>
</fieldset>
<div class="top-air fields-apart-from-layer-name" id="form-actions">
<button class="btn btn-primary btn-lg" data-toggle="modal" id="import-and-add-btn" data-target="#dependencies-message" disabled>Import and add to project</button>
<span class="help-inline" id="import-git-layer-and-add-hint" style="vertical-align: middle;">To import a layer you need to enter a layer name, a Git repository URL and a Git revision (branch, tag or commit)</span>
<span class="help-inline" id="import-local-dir-and-add-hint" style="vertical-align: middle;display:none;">To import a layer you need to enter a layer name and the absolute path to the layer directory</span>
</div>
</div>
</form>
{% else %} {#project and project release#}
<div class="page-header">

View File

@@ -36,7 +36,7 @@
</ul>
{# If this is not an imported layer then hide the edit ui #}
{% if not layerversion.layer_source_id or layerversion.layer_source.sourcetype != layerversion.layer_source.TYPE_IMPORTED %}
{% if layerversion.layer_source != layer_source.TYPE_IMPORTED %}
<style scoped>
.glyphicon-edit {
display:none;
@@ -69,8 +69,9 @@
inCurrentPrj : false,
{% endif %}
layerdetailurl : "{% url 'layerdetails' project.id layerversion.id %}",
sourceId: {{layerversion.layer_source_id|json}},
}
layer_source: {{layerversion.layer_source|json}},
},
layerSourceTypes: {{layer_source|json}},
};
try {
@@ -89,7 +90,6 @@
{% endif %}>({{layerversion.get_vcs_reference|truncatechars:13}})</small>
</h1>
</div>
<div class="row">
<!-- container for tabs -->
<div class="col-md-8 tabbable">
@@ -277,15 +277,15 @@
<span class="glyphicon glyphicon-edit"></span>
<span class="glyphicon glyphicon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span>
</dd>
{% if layerversion.layer.up_id %}
{% if layerversion.layer_source == layer_source.TYPE_LAYERINDEX %}
<dt>Layer index</dt>
<dd>
<a href="http://layers.openembedded.org/layerindex/branch/{{layerversion.up_branch.name}}/layer/{{layerversion.layer.name}}">layer index link</a>
<a href="http://layers.openembedded.org/layerindex/branch/{{layerversion.release.name}}/layer/{{layerversion.layer.name}}">Layer index {{layerversion.layer.name}}</a>
</dd>
{% endif %}
</dl>
{% if layerversion.layer_source_id and layerversion.layer_source.sourcetype == layerversion.layer_source.TYPE_IMPORTED %}
{# Only show delete link for imported layers #}
{% if layerversion.layer_source == layer_source.TYPE_IMPORTED %}
<i class="icon-trash text-danger"></i>
<a href="#delete-layer-modal" role="button" class="text-danger" data-toggle="modal" data-target="#delete-layer-modal">Delete {{layerversion.layer.name}}</a>
{% endif %}

View File

@@ -1,26 +1,9 @@
{% load static %}
{% load projecttags %}
{% load project_url_tag %}
{% load humanize %}
{% load project_url_tag %}
<script src="{% static 'js/mrbsection.js' %}"></script>
<script>
$(document).ready(function () {
var ctx = {
mrbType : "{{mrb_type}}",
}
try {
mrbSectionInit(ctx);
} catch (e) {
document.write("Sorry, An error has occurred loading this page");
console.warn(e);
}
});
</script>
{% if mru %}
{% if mrb_type == 'project' %}
<h2>
Latest project builds
@@ -38,144 +21,254 @@
<div id="latest-builds">
{% for build in mru %}
<div data-latest-build-result="{{build.id}}" class="alert build-result {% if build.outcome == build.SUCCEEDED %}alert-success{% elif build.outcome == build.FAILED %}alert-danger{% else %}alert-info{% endif %}">
<!-- project title -->
{% if mrb_type != 'project' %}
<div class="row project-name">
<div class="col-md-12">
<small>
<a class="alert-link text-uppercase" href={% project_url build.project %}>{{build.project.name}}</a>
<a class="alert-link text-uppercase" href="{% project_url build.project %}">
{{build.project.name}}
</a>
</small>
</div>
</div>
{% endif %}
<div class="row">
<div class="col-md-3">
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<a href="{% url 'builddashboard' build.pk %}" class="alert-link">
{% endif %}
{% if build.target_set.all.count > 0 %}
<span data-toggle="tooltip"
{% if build.target_set.all.count > 1 %}
{{build.get_sorted_target_list.0.target}}
title="Recipes:
{% for target in build.get_sorted_target_list %}
{% if target.task %}
{{target.target}}:{{target.task}}
{% else %}
{{target.target}}
{% endif %}
{% endfor %}"
{% endif %}
>
{% if build.target_set.all.0.task %}
{{build.get_sorted_target_list.0.target}}:{{build.target_set.all.0.task}}
{% else %}
{{build.get_sorted_target_list.0.target}}
{% endif %}
{% if build.target_set.all.count > 1 %}
(+{{build.target_set.all.count|add:"-1"}})
{% endif %}
</span>
{% endif %}
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
</a>
{% endif %}
<div class="row" data-role="build-status-container">
<div class="col-md-12">
Loading...
</div>
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<div class="col-md-2">
{% if build.completed_on|format_build_date %}
{{build.completed_on|date:'d/m/y H:i'}}
{% else %}
{{ build.completed_on|date:'H:i' }}
{% endif %}
</div>
{% endif %}
{% if build.outcome == build.SUCCEEDED or build.outcome == build.FAILED %}
<div class="col-md-2">
{% if build.errors.count %}
<span class="glyphicon glyphicon-minus-sign"></span>
<a href="{%url 'builddashboard' build.pk%}#errors" class="alert-link">
{{build.errors.count}} error{{build.errors.count|pluralize}}
</a>
{% endif %}
</div>
<div class="col-md-2">
{% if build.warnings.count %}
<span class="glyphicon glyphicon-warning-sign build-warnings"></span>
<a href="{%url 'builddashboard' build.pk%}#warnings" class="alert-link build-warnings">
{{build.warnings.count}} warning{{build.warnings.count|pluralize}}
</a>
{% endif %}
</div>
<div class="col-md-3">
Build time: <a class="alert-link" href="{% url 'buildtime' build.pk %}">{{ build.timespent_seconds|sectohms }}
</a>
{% if build.project.is_default %}
<span class="pull-right glyphicon glyphicon-question-sign get-help {% if build.outcome == build.SUCCEEDED %}get-help-green{% elif build.outcome == build.FAILED %}get-help-red{% else %}get-help-blue{% endif %}"
title="Builds in this project cannot be started from Toaster: they are started from the command line">
</span>
{% else %}
<a href="#" class="run-again-btn alert-link {% if build.outcome == build.SUCCEEDED %}success{% elif build.outcome == build.FAILED %}danger{% else %}info{% endif %} pull-right"
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
data-target='{{build.target_set.all|get_tasks|json}}'>
<span class="glyphicon glyphicon-repeat"></span>
Rebuild
</a>
{% endif %}
</div>
{% endif %}
{% if build.outcome == build.IN_PROGRESS %}
<div class="col-md-4" style="display:none" id="cancelling-msg-{{build.buildrequest.pk}}">
Cancelling the build ...
</div>
<div class="col-md-4 col-md-offset-1 progress-info">
<div class="progress" id="build-pc-done-title-{{build.pk}}">
<div id="build-pc-done-bar-{{build.pk}}" style="width: {{build.completeper}}%;" class="progress-bar">
</div>
</div>
</div>
<div class="col-md-4 progress-info">
<span id="build-pc-done-{{build.pk}}">{{build.completeper}}</span>% of tasks complete
{# No build cancel for command line builds project #}
{% if build.project.is_default %}
<span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
{% else %}
<a href="#" class="cancel-build-btn pull-right alert-link"
data-buildrequest-id={{build.buildrequest.pk}}
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}">
<span class="glyphicon glyphicon-remove-circle"></span>
Cancel
</a>
{% endif %}
</div>
{% endif %} {# end if in progress #}
{% if build.outcome == build.CANCELLED %}
<div class="col-md-6">
Build cancelled
</div>
<div class="col-md-3">
<a href="#" class="info pull-right run-again-btn alert-link"
data-request-url="{% url 'xhr_buildrequest' build.project.pk %}"
data-target='{{build.target_set.all|get_tasks|json}}'>
<span class="glyphicon glyphicon-repeat"></span>
Rebuild
</a>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endif %}
{% endif %}
<!-- build main template -->
<script id="build-template" type="text/x-jsrender">
<div class="col-md-3">
<!-- only show link for completed builds -->
<%if state == 'Succeeded' || state == 'Failed'%>
<a class="alert-link" href="<%:dashboard_url%>">
<span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
<%:targets_abbreviated%>
</span>
</a>
<%else targets_abbreviated !== ''%>
<span data-toggle="tooltip" data-role="targets-text" title="Recipes: <%:targets%>">
<%:targets_abbreviated%>
</span>
<%else%>
Fetching recipe names...
<%/if%>
</div>
<div data-build-state="<%:state%>">
<%if state == 'Parsing'%>
<%include tmpl='#parsing-recipes-build-template'/%>
<%else state == 'Queued'%>
<%include tmpl='#queued-build-template'/%>
<%else state == 'Succeeded' || state == 'Failed'%>
<%include tmpl='#succeeded-or-failed-build-template'/%>
<%else state == 'Cancelling'%>
<%include tmpl='#cancelling-build-template'/%>
<%else state == 'Starting'%>
<%include tmpl='#starting-template'/%>
<%else state == 'In Progress'%>
<%include tmpl='#in-progress-build-template'/%>
<%else state == 'Cancelled'%>
<%include tmpl='#cancelled-build-template'/%>
<%/if%>
</div>
</script>
<!-- queued build -->
<script id="queued-build-template" type="text/x-jsrender">
<div class="col-md-5">
<span class="glyphicon glyphicon-question-sign get-help get-help-blue"
title="This build is waiting for the build directory to become available">
</span>
Build queued
</div>
<div class="col-md-4">
<!-- cancel button -->
<%include tmpl='#cancel-template'/%>
</div>
</script>
<!-- parsing recipes build -->
<script id="parsing-recipes-build-template" type="text/x-jsrender">
<!-- progress bar and parse completion percentage -->
<div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
<!-- progress bar -->
<div class="progress">
<div id="recipes-parsed-percentage-bar-<%:id%>"
style="width: <%:recipes_parsed_percentage%>%;"
class="progress-bar">
</div>
</div>
</div>
<div class="col-md-4 progress-info">
<!-- parse completion percentage -->
<span class="glyphicon glyphicon-question-sign get-help get-help-blue"
title="BitBake is parsing the layers required for your build">
</span>
Parsing <span id="recipes-parsed-percentage-<%:id%>"><%:recipes_parsed_percentage%></span>% complete
<%include tmpl='#cancel-template'/%>
</div>
</script>
<!-- in progress build; tasks still starting -->
<script id="starting-template" type="text/x-jsrender">
<div class="col-md-5">
<span class="glyphicon glyphicon-question-sign get-help get-help-blue"
title="This build is waiting for tasks to start">
</span>
Tasks starting...
</div>
<div class="col-md-4">
<!-- cancel button -->
<%include tmpl='#cancel-template'/%>
</div>
</script>
<!-- in progress build; at least one task finished -->
<script id="in-progress-build-template" type="text/x-jsrender">
<!-- progress bar and task completion percentage -->
<div data-role="build-status" class="col-md-4 col-md-offset-1 progress-info">
<!-- progress bar -->
<div class="progress" id="build-pc-done-title-<%:id%>">
<div id="build-pc-done-bar-<%:id%>"
style="width: <%:tasks_complete_percentage%>%;"
class="progress-bar">
</div>
</div>
</div>
<div class="col-md-4 progress-info">
<!-- task completion percentage -->
<span id="build-pc-done-<%:id%>"><%:tasks_complete_percentage%></span>% of
tasks complete
<!-- cancel button -->
<%include tmpl='#cancel-template'/%>
</div>
</script>
<!-- cancelling build -->
<script id="cancelling-build-template" type="text/x-jsrender">
<div class="col-md-9">
Cancelling the build ...
</div>
</script>
<!-- succeeded or failed build -->
<script id="succeeded-or-failed-build-template" type="text/x-jsrender">
<!-- completed_on -->
<div class="col-md-2">
<%:completed_on%>
</div>
<!-- errors -->
<div class="col-md-2">
<%if errors%>
<span class="glyphicon glyphicon-minus-sign"></span>
<a href="<%:dashboard_errors_url%>" class="alert-link">
<%:errors%> error<%:errors_pluralise%>
</a>
<%/if%>
</div>
<!-- warnings -->
<div class="col-md-2">
<%if warnings%>
<span class="glyphicon glyphicon-warning-sign build-warnings"></span>
<a href="<%:dashboard_warnings_url%>" class="alert-link build-warnings">
<%:warnings%> warning<%:warnings_pluralise%>
</a>
<%/if%>
</div>
<!-- build time -->
<div class="col-md-3">
Build time:
<span data-role="data-recent-build-buildtime-field">
<%if state == 'Succeeded'%>
<a class="alert-link" href="<%:buildtime_url%>"><%:buildtime%></a>
<%else%>
<%:buildtime%>
<%/if%>
</span>
<!-- rebuild button -->
<%include tmpl='#rebuild-template'/%>
</div>
</script>
<!-- cancelled build -->
<script id="cancelled-build-template" type="text/x-jsrender">
<!-- build cancelled message -->
<div class="col-md-6">
Build cancelled
</div>
<!-- rebuild button -->
<div class="col-md-3">
<%include tmpl='#rebuild-template'/%>
</div>
</script>
<!-- rebuild button or no rebuild icon -->
<script id="rebuild-template" type="text/x-jsrender">
<%if is_default_project_build%>
<!-- no rebuild info icon -->
<span class="pull-right glyphicon glyphicon-question-sign get-help <%if state == 'Succeeded'%>get-help-green<%else state == 'Failed'%>get-help-red<%else%>get-help-blue<%/if%>"
title="Builds in this project cannot be started from Toaster: they are started from the command line">
</span>
<%else%>
<!-- rebuild button -->
<span class="rebuild-btn alert-link <%if state == 'Success'%>success<%else state == 'Failed'%>danger<%else%>info<%/if%> pull-right"
data-request-url="<%:rebuild_url%>" data-target='<%:build_targets_json%>'>
<span class="glyphicon glyphicon-repeat"></span>
Rebuild
</span>
<%/if%>
</script>
<!-- cancel button or no cancel icon -->
<script id="cancel-template" type="text/x-jsrender">
<%if is_default_project_build%>
<!-- no cancel icon -->
<span class="glyphicon glyphicon-question-sign get-help get-help-blue pull-right" title="Builds in this project cannot be cancelled from Toaster: they can only be cancelled from the command line"></span>
<%else%>
<!-- cancel button -->
<span class="cancel-build-btn pull-right alert-link"
data-buildrequest-id="<%:buildrequest_id%>" data-request-url="<%:cancel_url%>">
<span class="glyphicon glyphicon-remove-circle"></span>
Cancel
</span>
<%/if%>
</script>
<script>
$(document).ready(function () {
var ctx = {
mrbType : "{{mrb_type}}",
}
try {
mrbSectionInit(ctx);
} catch (e) {
document.write("Sorry, An error has occurred loading this page");
console.warn(e);
}
});
</script>

View File

@@ -48,7 +48,12 @@
</div>
<div class="modal-footer">
<button id="create-new-custom-image-btn" class="btn btn-primary btn-lg" data-original-title="" title="" disabled>Create custom image</button>
<button id="create-new-custom-image-btn" class="btn btn-primary btn-large" disabled>
<span data-role="submit-state">Create custom image</span>
<span data-role="loading-state" style="display:none">
<i class="fa-pulse icon-spinner"></i>&nbsp;Creating custom image...
</span>
</button>
</div>
</div>
</div>

View File

@@ -133,19 +133,33 @@
{% endcomment %}
{% endif %}
</dd>
{% if package.recipe.layer_version.branch %}
<dt>
Layer branch
<span class="glyphicon glyphicon-question-sign get-help" title="The Git branch of the layer providing the recipe that builds this package"></span>
{%if package.recipe.layer_version.layer.local_source_dir %}
<dd>
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" title="The source code of {{package.recipe.layer_version.layer.name}} is not in a Git repository, so there is no branch associated with it"></span>
</dd>
{% endif %}
</dt>
{% if not package.recipe.layer_version.layer.local_source_dir %}
<dd>{{package.recipe.layer_version.branch}}</dd>
{% endif %}
{% endif %}
<dt>
Layer commit
<span class="glyphicon glyphicon-question-sign get-help" title="The Git commit of the layer providing the recipe that builds this package"></span>
{%if package.recipe.layer_version.layer.local_source_dir %}
<dd>
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" title="The source code of {{package.recipe.layer_version.layer.name}} is not in a Git repository, so there is no commit associated with it"></span>
</dd>
{% endif %}
</dt>
{% if not package.recipe.layer_version.layer.local_source_dir %}
<dd class="iscommit">{{package.recipe.layer_version.commit}}</dd>
{% endif %}
</dl>
<div> <!-- end well -->

View File

@@ -24,7 +24,7 @@
<h2 class="top-air" data-role="page-title"></h2>
{% if not build_in_progress_none_completed %}
{% if not build_in_progress_none_completed %}
{% url 'projectbuilds' project.id as xhr_table_url %}
{% include 'toastertable.html' %}
{% endif %}

View File

@@ -69,21 +69,37 @@
Recipe file
</dt>
<dd><code>{{object.file_path}} {% if object.pathflags %}<i>({{object.pathflags}})</i>{% endif %}</code></dd>
{% if layer_version.branch %}
<dt>
<span class="glyphicon glyphicon-question-sign get-help"
title="The Git branch of the layer providing the
recipe"></span>
Layer branch
</dt>
{% if layer_version.layer.local_source_dir %}
<dd>
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" title="The source
code of {{layer_version.layer.name}} is not in a git repository
so there is no branch associated with it"></span>
</dd>
{% else %}
<dd>{{layer_version.branch}}</dd>
{% endif %}
{% endif %}
<dt>
<span class="glyphicon glyphicon-question-sign get-help" title="The Git
commit of the layer providing the recipe"></span>
Layer commit
</dt>
{% if layer_version.layer.local_source_dir %}
<dd>
<span class="text-muted">Not applicable</span>
<span class="glyphicon glyphicon-question-sign get-help" title="The source
code of {{layer_version.layer.name}} is not in a git repository
so there is no commit associated with it"></span>
</dd>
{% else %}
<dd class="iscommit">{{layer_version.commit}}</dd>
{% endif %}
{% if object.provides_set.all %}
<dt>
<span class="glyphicon glyphicon-question-sign get-help"

View File

@@ -25,8 +25,10 @@
{%if task.task_executed %}
{# executed tasks outcome #}
{% if task.logfile %}
<a class="btn btn-default btn-lg" href="{% url 'build_artifact' build.id
"tasklogfile" task.pk %}">Download task log</a>
<a class="btn btn-default btn-lg"
href="{% url 'build_artifact' build.id 'tasklogfile' task.pk %}">
Download task log
</a>
{% endif %}
{# show stack trace for failed task #}
{% if task.outcome == task.OUTCOME_FAILED and log_head %}
@@ -156,8 +158,10 @@ this prebuilt task is reusing"></span></a>
{%elif task.outcome == task.OUTCOME_CACHED%}
{% for t in task.get_related_setscene %}
{% if forloop.last %}
<a class="btn btn-default btn-lg" href="{% url
'build_artifact' build.id "tasklogfile" t.pk %}">Download task log</a>
<a class="btn btn-default btn-lg"
href="{% url 'build_artifact' build.id "tasklogfile" t.pk %}">
Download task log
</a>
{% endif %}
{% endfor %}

View File

@@ -270,14 +270,6 @@ def get_dict_value(dictionary, key):
except (KeyError, IndexError):
return ''
@register.filter
def format_build_date(completed_on):
now = timezone.now()
delta = now - completed_on
if delta.days >= 1:
return True
@register.filter
def is_shaid(text):
""" return True if text length is 40 characters and all hex-digits

View File

@@ -28,10 +28,10 @@ from django.utils import timezone
from django.db.models import Q
from orm.models import Project, Release, BitbakeVersion, Package, LogMessage
from orm.models import ReleaseLayerSourcePriority, LayerSource, Layer, Build
from orm.models import LayerSource, Layer, Build
from orm.models import Layer_Version, Recipe, Machine, ProjectLayer, Target
from orm.models import CustomImageRecipe, ProjectVariable
from orm.models import Branch, CustomImagePackage
from orm.models import CustomImagePackage
import toastermain
import inspect
@@ -149,12 +149,12 @@ class ViewTests(TestCase):
def test_xhr_import_layer(self):
"""Test xhr_importlayer API"""
LayerSource.objects.create(sourcetype=LayerSource.TYPE_IMPORTED)
#Test for importing an already existing layer
args = {'vcs_url' : "git://git.example.com/test",
'name' : "base-layer",
'git_ref': "c12b9596afd236116b25ce26dbe0d793de9dc7ce",
'project_id': self.project.id,
'local_source_dir': "",
'dir_path' : "/path/in/repository"}
response = self.client.post(reverse('xhr_importlayer'), args)
data = json.loads(response.content.decode('utf-8'))

View File

@@ -55,6 +55,7 @@ class LayersTypeAhead(ToasterTypeAhead):
'vcs_url' : layer_version.layer.vcs_url,
'vcs_reference' : vcs_reference,
'detail' : detail,
'local_source_dir' : layer_version.layer.local_source_dir,
}
results.append(needed_fields)

View File

@@ -214,6 +214,9 @@ urlpatterns = patterns('toastergui.views',
api.XhrBuildRequest.as_view(),
name='xhr_buildrequest'),
url(r'^mostrecentbuilds$', api.MostRecentBuildsView.as_view(),
name='most_recent_builds'),
# default redirection
url(r'^$', RedirectView.as_view(url='landing', permanent=True)),
)

View File

@@ -161,7 +161,7 @@ def _lv_to_dict(prj, x = None):
return {"id": x.pk,
"name": x.layer.name,
"tooltip": "%s | %s" % (x.layer.vcs_url,x.get_vcs_reference()),
"detail": "(%s" % x.layer.vcs_url + (")" if x.up_branch == None else " | "+x.get_vcs_reference()+")"),
"detail": "(%s" % x.layer.vcs_url + (")" if x.release == None else " | "+x.get_vcs_reference()+")"),
"giturl": x.layer.vcs_url,
"layerdetailurl" : reverse('layerdetails', args=(prj.id,x.pk)),
"revision" : x.get_vcs_reference(),
@@ -822,11 +822,21 @@ def _find_task_dep(task_object):
def _find_task_revdep(task_object):
tdeps = Task_Dependency.objects.filter(depends_on=task_object).filter(task__order__gt=0)
tdeps = tdeps.exclude(task__outcome = Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")
# exclude self-dependencies to prevent infinite dependency loop
# in generateCoveredList2()
tdeps = tdeps.exclude(task=task_object)
return [tdep.task for tdep in tdeps]
def _find_task_revdep_list(tasklist):
tdeps = Task_Dependency.objects.filter(depends_on__in=tasklist).filter(task__order__gt=0)
tdeps = tdeps.exclude(task__outcome=Task.OUTCOME_NA).select_related("task", "task__recipe", "task__build")
# exclude self-dependencies to prevent infinite dependency loop
# in generateCoveredList2()
tdeps = tdeps.exclude(task=F('depends_on'))
return [tdep.task for tdep in tdeps]
def _find_task_provider(task_object):
@@ -1288,7 +1298,7 @@ if True:
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from orm.models import Branch, LayerSource, ToasterSetting, Release, Machine, LayerVersionDependency
from orm.models import LayerSource, ToasterSetting, Release, Machine, LayerVersionDependency
from bldcontrol.models import BuildRequest
import traceback
@@ -1450,11 +1460,10 @@ if True:
freqtargets = tmp
layers = [{"id": x.layercommit.pk, "orderid": x.pk, "name" : x.layercommit.layer.name,
"vcs_url": x.layercommit.layer.vcs_url, "vcs_reference" : x.layercommit.get_vcs_reference(),
"vcs_url": x.layercommit.layer.vcs_url, "local_source_dir": x.layercommit.layer.local_source_dir, "vcs_reference" : x.layercommit.get_vcs_reference(),
"url": x.layercommit.layer.layer_index_url, "layerdetailurl": x.layercommit.get_detailspage_url(prj.pk),
# This branch name is actually the release
"branch" : {"name" : x.layercommit.get_vcs_reference(),
"layersource" : x.layercommit.up_branch.layer_source.name if x.layercommit.up_branch != None else None}
"layersource" : x.layercommit.layer_source }
} for x in prj.projectlayer_set.all().order_by("id")]
context = {
@@ -1662,18 +1671,12 @@ if True:
prj = Project.objects.get(pk=request.POST['project_id'])
# Strip trailing/leading whitespace from all values
# put into a new dict because POST one is immutable
# put into a new dict because POST one is immutable.
post_data = dict()
for key,val in request.POST.items():
post_data[key] = val.strip()
# We need to know what release the current project is so that we
# can set the imported layer's up_branch_id
prj_branch_name = Release.objects.get(pk=prj.release_id).branch_name
up_branch, branch_created = Branch.objects.get_or_create(name=prj_branch_name, layer_source_id=LayerSource.TYPE_IMPORTED)
layer_source = LayerSource.objects.get(sourcetype=LayerSource.TYPE_IMPORTED)
try:
layer, layer_created = Layer.objects.get_or_create(name=post_data['name'])
except MultipleObjectsReturned:
@@ -1681,8 +1684,8 @@ if True:
if layer:
if layer_created:
layer.layer_source = layer_source
layer.vcs_url = post_data['vcs_url']
layer.vcs_url = post_data.get('vcs_url')
layer.local_source_dir = post_data.get('local_source_dir')
layer.up_date = timezone.now()
layer.save()
else:
@@ -1692,12 +1695,24 @@ if True:
if layer.vcs_url != post_data['vcs_url']:
return HttpResponse(jsonfilter({"error": "hint-layer-exists-with-different-url" , "current_url" : layer.vcs_url, "current_id": layer.id }), content_type = "application/json")
layer_version, version_created = Layer_Version.objects.get_or_create(layer_source=layer_source, layer=layer, project=prj, up_branch_id=up_branch.id,branch=post_data['git_ref'], commit=post_data['git_ref'], dirpath=post_data['dir_path'])
layer_version, version_created = \
Layer_Version.objects.get_or_create(
layer_source=LayerSource.TYPE_IMPORTED,
layer=layer, project=prj,
release=prj.release,
branch=post_data['git_ref'],
commit=post_data['git_ref'],
dirpath=post_data['dir_path'])
if layer_version:
if not version_created:
return HttpResponse(jsonfilter({"error": "hint-layer-version-exists", "existing_layer_version": layer_version.id }), content_type = "application/json")
return HttpResponse(jsonfilter({"error":
"hint-layer-version-exists",
"existing_layer_version":
layer_version.id }),
content_type = "application/json")
layer_version.layer_source = LayerSource.TYPE_IMPORTED
layer_version.up_date = timezone.now()
layer_version.save()
@@ -1752,7 +1767,6 @@ if True:
return HttpResponse(jsonfilter(json_response), content_type = "application/json")
@xhr_response
def xhr_customrecipe(request):
"""
@@ -2179,20 +2193,33 @@ if True:
}
return render(request, template, context)
# TODO merge with api pseudo api here is used for deps modal
@_template_renderer('layerdetails.html')
def layerdetails(request, pid, layerid):
project = Project.objects.get(pk=pid)
layer_version = Layer_Version.objects.get(pk=layerid)
context = {'project' : project,
'layerversion' : layer_version,
'layerdeps' : {"list": [{"id": dep.id,
"name": dep.layer.name,
"layerdetailurl": reverse('layerdetails', args=(pid, dep.pk)),
"vcs_url": dep.layer.vcs_url,
"vcs_reference": dep.get_vcs_reference()} \
for dep in layer_version.get_alldeps(project.id)]},
'projectlayers': [player.layercommit.id for player in ProjectLayer.objects.filter(project=project)]
project_layers = ProjectLayer.objects.filter(
project=project).values_list("layercommit_id",
flat=True)
context = {
'project': project,
'layer_source': LayerSource.types_dict(),
'layerversion': layer_version,
'layerdeps': {
"list": [
{
"id": dep.id,
"name": dep.layer.name,
"layerdetailurl": reverse('layerdetails',
args=(pid, dep.pk)),
"vcs_url": dep.layer.vcs_url,
"vcs_reference": dep.get_vcs_reference()
}
for dep in layer_version.get_alldeps(project.id)]
},
'projectlayers': list(project_layers)
}
return context

View File

@@ -194,7 +194,14 @@
class or the
<link linkend='ref-classes-package'><filename>package</filename></link>
class.
</para>
<para>
The class also contains some commonly used functions such as
<filename>oe_runmake</filename>, which runs
<filename>make</filename> with the arguments specified in
<link linkend='var-EXTRA_OEMAKE'><filename>EXTRA_OEMAKE</filename></link>
variable as well as the arguments passed directly to
<filename>oe_runmake</filename>.
</para>
</section>
@@ -1599,6 +1606,17 @@
<link linkend='var-FILES'><filename>FILES</filename></link>
variable values that contain "//", which is invalid.
</para></listitem>
<listitem><para><emphasis><filename>host-user-contaminated:</filename></emphasis>
Checks that no package produced by the recipe contains any
files outside of <filename>/home</filename> with a user or
group ID that matches the user running BitBake.
A match usually indicates that the files are being installed
with an incorrect UID/GID, since target IDs are independent
from host IDs.
For additional information, see the section describing the
<link linkend='ref-tasks-install'><filename>do_install</filename></link>
task.
</para></listitem>
<listitem><para><emphasis><filename>incompatible-license:</filename></emphasis>
Report when packages are excluded from being created due to
being marked with a license that is in
@@ -1626,6 +1644,25 @@
<filename>do_install</filename> if the files are not
needed in any package.
</para></listitem>
<listitem><para><emphasis><filename>invalid-chars:</filename></emphasis>
Checks that the recipe metadata variables
<link linkend='var-DESCRIPTION'><filename>DESCRIPTION</filename></link>,
<link linkend='var-SUMMARY'><filename>SUMMARY</filename></link>,
<link linkend='var-LICENSE'><filename>LICENSE</filename></link>,
and
<link linkend='var-SECTION'><filename>SECTION</filename></link>
do not contain non-UTF-8 characters.
Some package managers do not support such characters.
</para></listitem>
<listitem><para><emphasis><filename>invalid-packageconfig:</filename></emphasis>
Checks that no undefined features are being added to
<link linkend='var-PACKAGECONFIG'><filename>PACKAGECONFIG</filename></link>.
For example, any name "foo" for which the following form
does not exist:
<literallayout class='monospaced'>
PACKAGECONFIG[foo] = "..."
</literallayout>
</para></listitem>
<listitem><para><emphasis><filename>la:</filename></emphasis>
Checks <filename>.la</filename> files for any <filename>TMPDIR</filename>
paths.

View File

@@ -35,43 +35,23 @@
</para>
</section>
<section id='ref-tasks-checkpkg'>
<title><filename>do_checkpkg</filename></title>
<para>
Provides information about the recipe including its upstream
version and status.
The upstream version and status reveals whether or not a version
of the recipe exists upstream and a status of not updated, updated,
or unknown.
</para>
<para>
The <filename>checkpkg</filename> task is included as part of the
<link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
class.
</para>
<para>
To build the <filename>checkpkg</filename> task, use the
<filename>bitbake</filename> command with the "-c" option and
task name:
<literallayout class='monospaced'>
$ bitbake core-image-minimal -c checkpkg
</literallayout>
By default, the results are stored in
<link linkend='var-LOG_DIR'><filename>$LOG_DIR</filename></link>
(e.g. <filename>$BUILD_DIR/tmp/log</filename>).
</para>
</section>
<section id='ref-tasks-compile'>
<title><filename>do_compile</filename></title>
<para>
Compiles the source in the compilation directory, which is pointed
to by the
<link linkend='var-B'><filename>B</filename></link> variable.
Compiles the source code.
This task runs with the current working directory set
to
<filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>.
</para>
<para>
The default behavior of this task is to run the
<filename>oe_runmake</filename> task if a makefile
(<filename>Makefile</filename>, <filename>makefile</filename>,
or <filename>GNUmakefile</filename>) is found.
If no such file is found, the <filename>do_compile</filename>
task does nothing.
</para>
</section>
@@ -90,6 +70,20 @@
<para>
Configures the source by enabling and disabling any build-time and
configuration options for the software being built.
The task runs with the current working directory set to
<filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>.
</para>
<para>
The default behavior of this task is to run
<filename>oe_runmake clean</filename> if a makefile
(<filename>Makefile</filename>, <filename>makefile</filename>,
or <filename>GNUmakefile</filename>) is found and
<link linkend='var-CLEANBROKEN'><filename>CLEANBROKEN</filename></link>
is not set to "1".
If no such file is found or the <filename>CLEANBROKEN</filename>
variable is set to "1", the <filename>do_configure</filename>
task does nothing.
</para>
</section>
@@ -106,18 +100,62 @@
<title><filename>do_deploy</filename></title>
<para>
Writes output files that are to be deployed to the deploy
directory, which is defined by the
<link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link>
variable.
Writes output files that are to be deployed to
<filename>${</filename><link linkend='var-DEPLOY_DIR_IMAGE'><filename>DEPLOY_DIR_IMAGE</filename></link><filename>}</filename>.
The task runs with the current working directory set to
<filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>.
</para>
<para>
The <filename>do_deploy</filename> task is a
shared state (sstate) task, which means that the task can
be accelerated through sstate use.
Realize also that if the task is re-executed, any previous output
is removed (i.e. "cleaned").
Recipes implementing this task should inherit the
<link linkend='ref-classes-deploy'><filename>deploy</filename></link>
class and should write the output to
<filename>${</filename><link linkend='var-DEPLOYDIR'><filename>DEPLOYDIR</filename></link><filename>}</filename>,
which is not to be confused with
<filename>${</filename><link linkend='var-DEPLOY_DIR'><filename>DEPLOY_DIR</filename></link><filename>}</filename>.
The <filename>deploy</filename> class sets up
<filename>do_deploy</filename> as a shared state (sstate) task that
can be accelerated through sstate use.
The sstate mechanism takes care of copying the output from
<filename>${DEPLOYDIR}</filename> to
<filename>${DEPLOY_DIR_IMAGE}</filename>.
<note>
<title>Caution</title>
Do not write the output directly to
<filename>${DEPLOY_DIR_IMAGE}</filename>, as this causes
the sstate mechanism to malfunction.
</note>
</para>
<para>
The <filename>do_deploy</filename> task is not added as a task
by default and consequently needs to be added manually.
If you want the task to run after
<link linkend='ref-tasks-compile'><filename>do_compile</filename></link>,
you can add it by doing the following:
<literallayout class='monospaced'>
addtask deploy after do_compile
</literallayout>
Adding <filename>do_deploy</filename> after other tasks works the
same way.
<note>
You do not need to add <filename>before do_build</filename>
to the <filename>addtask</filename> command (though it is
harmless), because the
<link linkend='ref-classes-base'><filename>base</filename></link>
class contains the following:
<literallayout class='monospaced'>
do_build[recrdeptask] += "do_deploy"
</literallayout>
See the
"<ulink url='&YOCTO_DOCS_BB_URL;#dependencies'>Dependencies</ulink>"
section in the BitBake User Manual for more information.
</note>
</para>
<para>
If the <filename>do_deploy</filename> task re-executes, any
previous output is removed (i.e. "cleaned").
</para>
</section>
@@ -217,11 +255,50 @@
<title><filename>do_install</filename></title>
<para>
Copies files from the compilation directory, which is defined by
the
<link linkend='var-B'><filename>B</filename></link> variable,
to a holding area defined by the
<link linkend='var-D'><filename>D</filename></link> variable.
Copies files that are to be packaged into the holding area
<filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>.
This task runs with the current working directory set to
<filename>${</filename><link linkend='var-B'><filename>B</filename></link><filename>}</filename>,
which is the compilation directory.
<note>
<title>Caution</title>
<para>
When installing files, be careful not to set the owner and
group IDs of the installed files to unintended values.
Some methods of copying files, notably when using the
recursive <filename>cp</filename> command, can preserve the
UID and/or GID of the original file, which is usually not
what you want.
The
<link linkend='ref-classes-insane'><filename>host-user-contaminated</filename></link>
QA check checks for files that probably have the wrong
ownership.
</para>
<para>
Safe methods for installing files include the following:
<itemizedlist>
<listitem><para>
The <filename>install</filename> utility.
This utility is the preferred method.
</para></listitem>
<listitem><para>
The <filename>cp</filename> command with the
"--no-preserve=ownership" option.
</para></listitem>
<listitem><para>
The <filename>tar</filename> command with the
"--no-same-owner" option.
See the <filename>bin_package.bbclass</filename>
file in the <filename>meta/classes</filename>
directory of the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
for an example.
</para></listitem>
</itemizedlist>
</para>
</note>
</para>
</section>
@@ -238,8 +315,15 @@
<title><filename>do_package</filename></title>
<para>
Analyzes the content of the holding area and splits it into subsets
based on available packages and files.
Analyzes the content of the holding area
<filename>${</filename><link linkend='var-D'><filename>D</filename></link><filename>}</filename>
and splits the content into subsets based on available packages
and files.
This task makes use of the
<link linkend='var-PACKAGES'><filename>PACKAGES</filename></link>
and
<link linkend='var-FILES'><filename>FILES</filename></link>
variables.
</para>
</section>
@@ -355,7 +439,9 @@
<para>
Copies a subset of the files installed by the
<link linkend='ref-tasks-install'><filename>do_install</filename></link>
task into the sysroot to make them available to other recipes.
task into the sysroot directory
<filename>${</filename><link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link><filename>}</filename>
to make them available to other recipes.
Files that would typically not be needed by other recipes at build
time are skipped.
Skipped files include files installed into
@@ -421,6 +507,36 @@
<filename>bitbake -c</filename> command-line option):
</para>
<section id='ref-tasks-checkpkg'>
<title><filename>do_checkpkg</filename></title>
<para>
Provides information about the recipe including its upstream
version and status.
The upstream version and status reveals whether or not a version
of the recipe exists upstream and a status of not updated, updated,
or unknown.
</para>
<para>
The <filename>checkpkg</filename> task is included as part of the
<link linkend='ref-classes-distrodata'><filename>distrodata</filename></link>
class.
</para>
<para>
To build the <filename>checkpkg</filename> task, use the
<filename>bitbake</filename> command with the "-c" option and
task name:
<literallayout class='monospaced'>
$ bitbake core-image-minimal -c checkpkg
</literallayout>
By default, the results are stored in
<link linkend='var-LOG_DIR'><filename>$LOG_DIR</filename></link>
(e.g. <filename>$BUILD_DIR/tmp/log</filename>).
</para>
</section>
<section id='ref-tasks-checkuri'>
<title><filename>do_checkuri</filename></title>

View File

@@ -536,7 +536,7 @@
By default, this directory is the same as the <link linkend='var-S'><filename>S</filename></link>
directory, which is defined as:
<literallayout class='monospaced'>
S = "${WORKDIR}/${BP}/"
S = "${WORKDIR}/${BP}"
</literallayout>
</para>
@@ -2597,7 +2597,7 @@
task.
This location defaults to:
<literallayout class='monospaced'>
${WORKDIR}/image
${<link linkend='var-WORKDIR'>WORKDIR</link>}/image
</literallayout>
</para>
</glossdef>
@@ -8035,6 +8035,31 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
</glossdef>
</glossentry>
<glossentry id='var-MULTIMACH_HOST_SYS'><glossterm>MULTIMACH_HOST_SYS</glossterm>
<info>
MULTIMACH_HOST_SYS[doc] = "Separates files for different machines such that you can build for multiple host machines using the same output directories."
</info>
<glossdef>
<para role="glossdeffirst">
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
Serves the same purpose as
<link linkend='var-MULTIMACH_TARGET_SYS'><filename>MULTIMACH_TARGET_SYS</filename></link>,
but for the "HOST" system, in situations that involve a
"HOST" and a "TARGET" system.
See the
<link linkend='var-STAGING_DIR_TARGET'><filename>STAGING_DIR_TARGET</filename></link>
variable for more information.
</para>
<para>
The default value of this variable is:
<literallayout class='monospaced'>
${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}
</literallayout>
</para>
</glossdef>
</glossentry>
<glossentry id='var-MULTIMACH_TARGET_SYS'><glossterm>MULTIMACH_TARGET_SYS</glossterm>
<info>
MULTIMACH_TARGET_SYS[doc] = "Separates files for different machines such that you can build for multiple target machines using the same output directories."
@@ -8042,10 +8067,33 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
<glossdef>
<para role="glossdeffirst">
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
Separates files for different machines such that you can build
for multiple target machines using the same output directories.
See the <link linkend='var-STAMP'><filename>STAMP</filename></link> variable
for an example.
Uniquely identifies the type of the target system for
which packages are being built.
This variable allows output for different types of target
systems to be put into different subdirectories of the same
output directory.
</para>
<para>
The default value of this variable is:
<literallayout class='monospaced'>
${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}
</literallayout>
Some classes (e.g.
<link linkend='ref-classes-cross-canadian'><filename>cross-canadian</filename></link>)
modify the <filename>MULTIMACH_TARGET_SYS</filename> value.
</para>
<para>
See the
<link linkend='var-STAMP'><filename>STAMP</filename></link>
variable for an example.
<link linkend='var-MULTIMACH_HOST_SYS'><filename>MULTIMACH_HOST_SYS</filename></link>
is the corresponding variable for the host system in
situations that involve a "HOST" and a "TARGET" system.
See the
<link linkend='var-STAGING_DIR_TARGET'><filename>STAGING_DIR_TARGET</filename></link>
variable for more information.
</para>
</glossdef>
</glossentry>
@@ -10178,6 +10226,18 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
Thus, the <filename>RDEPENDS</filename> variable has the
<filename>${PN}-dev</filename> package name as part of the
variable.
<note>
<title>Caution</title>
<filename>RDEPENDS_${PN}-dev</filename> includes
<filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}</filename>
by default.
This default is set in the BitBake configuration file
(<filename>meta/conf/bitbake.conf</filename>).
Be careful not to accidentally remove
<filename>${PN}</filename> when modifying
<filename>RDEPENDS_${PN}-dev</filename>.
Use the "+=" operator rather than the "=" operator.
</note>
</para>
<para>
@@ -10257,30 +10317,6 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
</glossdef>
</glossentry>
<glossentry id='var-REMOVE_PKG_SUPPORT'><glossterm>REMOVE_PKG_SUPPORT</glossterm>
<info>
REMOVE_PKG_SUPPORT[doc] = "Allows for removal of supporting packages for images that do not contain a package manager."
</info>
<glossdef>
<para role="glossdeffirst">
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
For images not containing a package manager,
<filename>REMOVE_PKG_SUPPORT</filename> allows the removal
of supporting packages.
Packages that will be uninstalled include:
<filename>update-rc.d</filename>,
<filename>base-passwd</filename>,
<filename>shadow</filename>,
<filename>run-postinsts</filename>, and
<filename>update-alternatives</filename>.
</para>
<para>
Set the variable to "1" to remove these packages.
</para>
</glossdef>
</glossentry>
<glossentry id='var-REQUIRED_DISTRO_FEATURES'><glossterm>REQUIRED_DISTRO_FEATURES</glossterm>
<info>
REQUIRED_DISTRO_FEATURES[doc] = "When a recipe inherits the distro_features_check class, this variable identifies distribution features that must exist in the current configuration in order for the OpenEmbedded build system to build the recipe."
@@ -12283,18 +12319,24 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
<glossentry id='var-STAGING_DIR_HOST'><glossterm>STAGING_DIR_HOST</glossterm>
<info>
STAGING_DIR_HOST[doc] = "Specifies the path to the primary sysroot directory for which the target is being built."
STAGING_DIR_HOST[doc] = "Specifies the path to the sysroot directory for the system that the component is built to run on."
</info>
<glossdef>
<para role="glossdeffirst">
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
Specifies the path to the primary sysroot directory for
which the target is being built.
Depending on the type of recipe and the build target, the
recipe's value is as follows:
Specifies the path to the sysroot directory for the system
that the component is built to run on (the system that hosts
the component).
This sysroot is the one that the recipe's
<link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
task copies files into.
Depending on the type of recipe and the build target,
<filename>STAGING_DIR_HOST</filename> can have the
following values:
<itemizedlist>
<listitem><para>For recipes building for the target
machine, the value is "${STAGING_DIR}/${MACHINE}".
machine, the value is
"${<link linkend='var-STAGING_DIR'>STAGING_DIR</link>}/${<link linkend='var-MACHINE'>MACHINE</link>}".
</para></listitem>
<listitem><para>For native recipes building
for the build host, the value is empty given the
@@ -12304,7 +12346,7 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
<listitem><para>For native SDK
recipes that build for the SDK
(<filename>nativesdk</filename>), the value is
"${STAGING_DIR}/${MULTIMACH_HOST_SYS}".
"${STAGING_DIR}/${<link linkend='var-MULTIMACH_HOST_SYS'>MULTIMACH_HOST_SYS</link>}".
</para></listitem>
</itemizedlist>
</para>
@@ -12313,27 +12355,29 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
<glossentry id='var-STAGING_DIR_NATIVE'><glossterm>STAGING_DIR_NATIVE</glossterm>
<info>
STAGING_DIR_NATIVE[doc] = "Specifies the path to the sysroot directory for the build host."
STAGING_DIR_NATIVE[doc] = "Specifies the path to the sysroot directory used when building components that run on the build host itself."
</info>
<glossdef>
<para role="glossdeffirst">
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
Specifies the path to the sysroot directory for the
build host.
Specifies the path to the sysroot directory used when
building components that run on the build host itself.
</para>
</glossdef>
</glossentry>
<glossentry id='var-STAGING_DIR_TARGET'><glossterm>STAGING_DIR_TARGET</glossterm>
<info>
STAGING_DIR_TARGET[doc] = "Specifies the path to the sysroot directory for the target for which the current recipe is being built."
STAGING_DIR_TARGET[doc] = "Specifies the path to the sysroot used for the system for which the component generates code."
</info>
<glossdef>
<para role="glossdeffirst">
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
Specifies the path to the sysroot directory for the
target for which the current recipe is being built.
In most cases, this path is the
Specifies the path to the sysroot used for the system for
which the component generates code.
For components that do not generate code, which is the
majority, <filename>STAGING_DIR_TARGET</filename> is set
to match
<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>.
</para>
@@ -12344,10 +12388,12 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
Using terminology from GNU, the primary system is referred
to as the "HOST" and the secondary, or different, system is
referred to as the "TARGET".
Thus, the binaries run on the "HOST" system and
Thus, the binaries run on the "HOST" system
and generate binaries for the "TARGET" system.
<filename>STAGING_DIR_TARGET</filename> points to the
sysroot used for the "TARGET" system.
The <filename>STAGING_DIR_HOST</filename> variable points
to the sysroot used for the "HOST" system, while
<filename>STAGING_DIR_TARGET</filename>
points to the sysroot used for the "TARGET" system.
</para>
</glossdef>
</glossentry>

View File

@@ -754,11 +754,13 @@
section in the BitBake User Manual.
</para></listitem>
<listitem><para>
The
<filename>do_deploy[dirs] = "${DEPLOYDIR} ${B}"</filename>
The <filename>do_deploy[dirs] = "${DEPLOYDIR} ${B}"</filename>
line creates <filename>${DEPLOYDIR}</filename> and
<filename>${B}</filename> before the
<filename>do_deploy</filename> task runs.
<filename>do_deploy</filename> task runs, and also sets
the current working directory of
<filename>do_deploy</filename> to
<filename>${B}</filename>.
For more information, see the
"<ulink url='&YOCTO_DOCS_BB_URL;#variable-flags'>Variable Flags</ulink>"
section in the BitBake User Manual.

View File

@@ -246,6 +246,80 @@
</para>
</section>
<section id='checking-for-missing-build-time-dependencies'>
<title>Checking for Missing Build-Time Dependencies</title>
<para>
A recipe might build successfully even though some of its
build-time dependencies are missing from
<link linkend='var-DEPENDS'><filename>DEPENDS</filename></link>.
Following are the two most common ways in which that can happen:
<itemizedlist>
<listitem><para>
The build-time dependency just happens to already exist in
the staging sysroot
(<link linkend='var-STAGING_DIR_HOST'><filename>STAGING_DIR_HOST</filename></link>)
by the time the recipe is built.
This situation occurs when the build-time dependency is
built earlier during recipe processing.
</para></listitem>
<listitem><para>
The component built by the recipe conditionally enables
functionality depending on whether it can find the
build-time dependency in the staging sysroot.
If the build-time dependency is missing, the corresponding
functionality is disabled.
This condition is known as a "floating dependency".
</para></listitem>
</itemizedlist>
</para>
<para>
Because dealing with the second case is more complex, focus will
be on the first case.
The
<link linkend='ref-classes-insane'><filename>build-deps</filename></link>
QA check checks that every library the component linked against is
declared as a build-time dependency.
If that is not the case, then the first situation described in the
previous list exists, and <filename>build-deps</filename> reports
a missing build-time dependency.
</para>
<para>
Another, more manual, way to check a recipe for missing build-time
dependencies of the first type is to build with an empty staging
sysroot.
This method can also find missing build-time dependencies
that are not in the form of libraries, which the
<filename>build-deps</filename> QA check is unable to find.
</para>
<para>
An easy way to empty the staging sysroots is to simply remove
<link linkend='var-TMPDIR'><filename>TMPDIR</filename></link>,
which is usually
<filename>${</filename><link linkend='var-BUILDDIR'><filename>BUILDDIR</filename></link><filename>}/tmp</filename>,
as it includes the staging sysroots.
Another, faster method to empty the staging sysroots is to use the
<filename>scripts/wipe-sysroot</filename> script,
which removes just the staging sysroots and keeps everything else
in <filename>TMPDIR</filename>.
<note>
The <filename>scripts/</filename> directory appears in
<filename>PATH</filename> after running the build environment
initialization script (i.e.
<link linkend='structure-core-script'><filename>oe-init-build-env</filename></link>
or
<link linkend='structure-memres-core-script'><filename>oe-init-build-env-memres</filename></link>),
which results in the ability to to run
<filename>wipe-sysroot</filename> immediately.
</note>
</para>
</section>
<section id='usingpoky-debugging-dependencies'>
<title>Dependency Graphs</title>
@@ -356,8 +430,8 @@
<section id='recipe-logging-mechanisms'>
<title>Recipe Logging Mechanisms</title>
<para>
Best practices exist while writing recipes that both log build
progress and act on build conditions such as warnings and errors.
The Yocto Project provides several logging functions for producing
debugging output and reporting errors and warnings.
For Python functions, the following logging functions exist.
All of these functions log to
<filename>${T}/log.do_</filename><replaceable>task</replaceable>,
@@ -411,13 +485,13 @@
<filename>bbplain</filename>, <filename>bbnote</filename>,
<filename>bbdebug</filename>, <filename>bbwarn</filename>,
<filename>bberror</filename>, and <filename>bbfatal</filename>.
</para>
<para>
For guidance on how logging is handled in both Python and Bash recipes, see the
<filename>logging.bbclass</filename> file in the
The
<link linkend='ref-classes-logging'><filename>logging</filename></link>
class implements these functions.
See that class in the
<filename>meta/classes</filename> folder of the
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>.
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>
for information.
</para>
<section id='logging-with-python'>

View File

@@ -48,7 +48,6 @@ RECIPE_MAINTAINER_pn-at-spi2-atk = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-at-spi2-core = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-atk = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-attr = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-augeas = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-autoconf = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-autogen-native = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-automake = "Robert Yang <liezhi.yang@windriver.com>"
@@ -229,7 +228,7 @@ RECIPE_MAINTAINER_pn-glib-networking = "Jussi Kukkonen <jussi.kukkonen@intel.com
RECIPE_MAINTAINER_pn-glibc = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-glibc-initial = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-glibc-locale = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-glibc-mrace = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-glibc-mtrace = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-glibc-scripts = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-glproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-gmp = "Robert Yang <liezhi.yang@windriver.com>"
@@ -237,6 +236,7 @@ RECIPE_MAINTAINER_pn-gnome-common = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-gnome-desktop-testing = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-gnome-desktop3 = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-gnome-doc-utils = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-gnome-themes-standard = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-gnu-config = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-gnu-efi = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-gnupg = "Hongxu Jia <hongxu.jia@windriver.com>"
@@ -277,7 +277,7 @@ RECIPE_MAINTAINER_pn-hicolor-icon-theme = "Jussi Kukkonen <jussi.kukkonen@intel.
RECIPE_MAINTAINER_pn-hostap-conf = "Maxin B. John <maxin.john@intel.com>"
RECIPE_MAINTAINER_pn-hostap-utils = "Maxin B. John <maxin.john@intel.com>"
RECIPE_MAINTAINER_pn-hwlatdetect = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-i2ctools = "Maxin B. John <maxin.john@intel.com>"
RECIPE_MAINTAINER_pn-i2c-tools = "Maxin B. John <maxin.john@intel.com>"
RECIPE_MAINTAINER_pn-icecc-create-env-native = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-icon-naming-utils = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-icu = "Alexander Kanavin <alexander.kanavin@intel.com>"
@@ -288,8 +288,8 @@ RECIPE_MAINTAINER_pn-initramfs-framework = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-initramfs-live-boot = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-initramfs-live-install = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-initramfs-live-install-efi = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-initramfs-live-install-efi-tests = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-initramfs-live-install-tests = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-initramfs-live-install-efi-testfs = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-initramfs-live-install-testfs = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-initscripts = "Ross Burton <ross.burton@intel.com>"
RECIPE_MAINTAINER_pn-inputproto = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-intltool = "Alexander Kanavin <alexander.kanavin@intel.com>"
@@ -312,10 +312,10 @@ RECIPE_MAINTAINER_pn-kexec-tools = "Alexander Kanavin <alexander.kanavin@intel.c
RECIPE_MAINTAINER_pn-keymaps = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-kmod = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-kmod-native = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-l3afpad = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-lame = "Tanu Kaskinen <tanuk@iki.fi>"
RECIPE_MAINTAINER_pn-latencytop = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-ldconfig-native = "Khem Raj <raj.khem@gmail.com>"
RECIPE_MAINTAINER_pn-leafpad = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-less = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-liba52 = "Tanu Kaskinen <tanuk@iki.fi>"
RECIPE_MAINTAINER_pn-libacpi = "Maxin B. John <maxin.john@intel.com>"
@@ -596,7 +596,7 @@ RECIPE_MAINTAINER_pn-pcmciautils = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-perf = "Bruce Ashfield <bruce.ashfield@windriver.com>"
RECIPE_MAINTAINER_pn-perl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-perl-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-piglit = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-piglit = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-pigz = "Hongxu Jia <hongxu.jia@windriver.com>"
RECIPE_MAINTAINER_pn-pinentry = "Armin Kuster <akuster808@gmail.com>"
RECIPE_MAINTAINER_pn-pixman = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
@@ -624,9 +624,7 @@ RECIPE_MAINTAINER_pn-puzzles = "Jussi Kukkonen <jussi.kukkonen@intel.com>"
RECIPE_MAINTAINER_pn-python = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-async = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-dbus = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-distribute = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-docutils = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-git = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-gitdb = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-imaging = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
@@ -635,9 +633,9 @@ RECIPE_MAINTAINER_pn-python-native = "Alejandro Hernandez <alejandro.hernandez@l
RECIPE_MAINTAINER_pn-python-nose = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-numpy = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-pexpect = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-ptyprocess = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-pycairo = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-pycurl = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-pygobject = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-pygtk = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-pyrex = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python-scons = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
@@ -647,13 +645,17 @@ RECIPE_MAINTAINER_pn-python-smartpm = "Alejandro Hernandez <alejandro.hernandez@
RECIPE_MAINTAINER_pn-python-smmap = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3 = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-async = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-dbus = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-distribute = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-docutils = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-git = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-gitdb = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-mako = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-nose = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-numpy = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-pip = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-pygobject = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-setuptools = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-python3-smmap = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-qemu = "Aníbal Limón <anibal.limon@linux.intel.com>"
@@ -718,6 +720,8 @@ RECIPE_MAINTAINER_pn-syslinux = "Alexander Kanavin <alexander.kanavin@intel.com>
RECIPE_MAINTAINER_pn-sysprof = "Alexander Kanavin <alexander.kanavin@intel.com>"
RECIPE_MAINTAINER_pn-sysstat = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-systemd = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-systemd-boot = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-systemd-bootchart = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-systemd-compat-units = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-systemd-serialgetty = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-systemd-systemctl-native = "Chen Qi <Qi.Chen@windriver.com>"
@@ -730,6 +734,7 @@ RECIPE_MAINTAINER_pn-tar = "Chen Qi <Qi.Chen@windriver.com>"
RECIPE_MAINTAINER_pn-tcf-agent = "Randy Witt <randy.e.witt@linux.intel.com>"
RECIPE_MAINTAINER_pn-tcl = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-tcp-wrappers = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-testexport-tarball = "Richard Purdie <richard.purdie@linuxfoundation.org>"
RECIPE_MAINTAINER_pn-texi2html = "Robert Yang <liezhi.yang@windriver.com>"
RECIPE_MAINTAINER_pn-texinfo = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"
RECIPE_MAINTAINER_pn-texinfo-dummy-native = "Alejandro Hernandez <alejandro.hernandez@linux.intel.com>"

View File

@@ -70,9 +70,10 @@ https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
CONNECTIVITY_CHECK_URIS ?= "https://www.example.com/"
SANITY_TESTED_DISTROS ?= " \
poky-1.7 \n \
poky-1.8 \n \
poky-2.0 \n \
poky-2.1 \n \
poky-2.2 \n \
Ubuntu-14.04 \n \
Ubuntu-14.10 \n \
Ubuntu-15.04 \n \
@@ -80,9 +81,10 @@ SANITY_TESTED_DISTROS ?= " \
Ubuntu-16.04 \n \
Fedora-22 \n \
Fedora-23 \n \
CentOS-7.* \n \
CentOSLinux-7.* \n \
Debian-8.* \n \
openSUSE-project-13.2 \n \
openSUSE-13.2 \n \
SUSELINUX-42.1 \n \
"
#
# OELAYOUT_ABI allows us to notify users when the format of TMPDIR changes in

View File

@@ -0,0 +1,6 @@
{
"test_install_package": {
"pkg": "socat",
"rm": true
}
}

View File

@@ -0,0 +1,55 @@
import os
from oeqa.oetest import oeRuntimeTest, skipModule
from oeqa.utils.commands import runCmd
from oeqa.utils.decorators import *
class Selftest(oeRuntimeTest):
@skipUnlessPassed("test_ssh")
@tag("selftest_package_install")
def test_install_package(self):
"""
Summary: Check basic package installation functionality.
Expected: 1. Before the test socat must be installed using scp.
2. After the test socat must be unistalled using ssh.
This can't be checked in this test.
Product: oe-core
Author: Mariano Lopez <mariano.lopez@intel.com>
"""
(status, output) = self.target.run("socat -V")
self.assertEqual(status, 0, msg="socat is not installed")
@skipUnlessPassed("test_install_package")
@tag("selftest_package_install")
def test_verify_unistall(self):
"""
Summary: Check basic package installation functionality.
Expected: 1. test_install_package must unistall socat.
This test is just to verify that.
Product: oe-core
Author: Mariano Lopez <mariano.lopez@intel.com>
"""
(status, output) = self.target.run("socat -V")
self.assertNotEqual(status, 0, msg="socat is still installed")
@tag("selftest_sdk")
def test_sdk(self):
result = runCmd("env -0")
sdk_path = search_sdk_path(result.output)
self.assertTrue(sdk_path, msg="Can't find SDK path")
tar_cmd = os.path.join(sdk_path, "tar")
result = runCmd("%s --help" % tar_cmd)
def search_sdk_path(env):
for line in env.split("\0"):
(key, _, value) = line.partition("=")
if key == "PATH":
for path in value.split(":"):
if "pokysdk" in path:
return path
return ""

View File

@@ -0,0 +1,56 @@
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
from oeqa.utils.decorators import testcase
import re
import os
import sys
import logging
class Systemdboot(oeSelfTest):
def _common_setup(self):
"""
Common setup for test cases: 1445, XXXX
"""
# Set EFI_PROVIDER = "gummiboot" and MACHINE = "genericx86-64" in conf/local.conf
features = 'EFI_PROVIDER = "systemd-boot"\n'
features += 'MACHINE = "genericx86-64"'
self.append_config(features)
def _common_build(self):
"""
Common build for test cases: 1445 , XXXX
"""
# Build a genericx86-64/efi gummiboot image
bitbake('mtools-native core-image-minimal')
@testcase(1445)
def test_efi_systemdboot_images_can_be_built(self):
"""
Summary: Check if systemd-boot images can be built correctly
Expected: 1. File systemd-boot.efi should be available in $poky/build/tmp/deploy/images/genericx86-64
2. 'systemd-boot" can be built correctly
Product: oe-core
Author: Jose Perez Carranza <jose.perez.carranza@intel.com>
AutomatedBy: Jose Perez Carranza <jose.perez.carranza@intel.com>
"""
# We'd use DEPLOY_DIR_IMAGE here, except that we need its value for
# MACHINE="genericx86-64 which is probably not the one configured
systemdbootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 'genericx86-64', 'systemd-bootx64.efi')
self._common_setup()
# Ensure we're actually testing that this gets built and not that
# it was around from an earlier build
bitbake('-c cleansstate systemd-boot')
runCmd('rm -f %s' % systemdbootfile)
self._common_build()
found = os.path.isfile(systemdbootfile)
self.assertTrue(found, 'Systemd-Boot file %s not found' % systemdbootfile)

View File

@@ -1,69 +0,0 @@
#
# Automatically generated make config: don't edit
# Fri Nov 23 15:49:33 2007
#
# TARGET_alpha is not set
# TARGET_arm is not set
# TARGET_bfin is not set
# TARGET_cris is not set
# TARGET_e1 is not set
# TARGET_frv is not set
# TARGET_h8300 is not set
# TARGET_hppa is not set
# TARGET_i386=y
# TARGET_i960 is not set
# TARGET_ia64 is not set
# TARGET_m68k is not set
# TARGET_microblaze is not set
# TARGET_mips is not set
# TARGET_nios is not set
# TARGET_nios2 is not set
# TARGET_powerpc is not set
# TARGET_sh is not set
# TARGET_sh64 is not set
# TARGET_sparc is not set
# TARGET_v850 is not set
# TARGET_vax is not set
TARGET_x86_64=y
#
# Target Architecture Features and Options
#
TARGET_ARCH="x86_64"
FORCE_OPTIONS_FOR_ARCH=y
# CONFIG_GENERIC_386 is not set
# CONFIG_386 is not set
# CONFIG_486 is not set
# CONFIG_586 is not set
# CONFIG_586MMX is not set
# CONFIG_686 is not set
# CONFIG_PENTIUMII is not set
# CONFIG_PENTIUMIII is not set
# CONFIG_PENTIUM4 is not set
# CONFIG_K6 is not set
# CONFIG_K7 is not set
# CONFIG_ELAN is not set
# CONFIG_CRUSOE is not set
# CONFIG_WINCHIPC6 is not set
# CONFIG_WINCHIP2 is not set
# CONFIG_CYRIXIII is not set
# CONFIG_NEHEMIAH is not set
TARGET_SUBARCH=""
#
# Using ELF file format
#
ARCH_LITTLE_ENDIAN=y
#
# Using Little Endian
#
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
UCLIBC_HAS_FPU=y
DO_C99_MATH=y
KERNEL_HEADERS="/usr/include"
HAVE_DOT_CONFIG=y
UCLIBC_HAS_FENV=y

View File

@@ -1,69 +0,0 @@
#
# Automatically generated make config: don't edit
# Fri Nov 23 15:49:33 2007
#
# TARGET_alpha is not set
# TARGET_arm is not set
# TARGET_bfin is not set
# TARGET_cris is not set
# TARGET_e1 is not set
# TARGET_frv is not set
# TARGET_h8300 is not set
# TARGET_hppa is not set
TARGET_i386=y
# TARGET_i960 is not set
# TARGET_ia64 is not set
# TARGET_m68k is not set
# TARGET_microblaze is not set
# TARGET_mips is not set
# TARGET_nios is not set
# TARGET_nios2 is not set
# TARGET_powerpc is not set
# TARGET_sh is not set
# TARGET_sh64 is not set
# TARGET_sparc is not set
# TARGET_v850 is not set
# TARGET_vax is not set
# TARGET_x86_64 is not set
#
# Target Architecture Features and Options
#
TARGET_ARCH="i386"
FORCE_OPTIONS_FOR_ARCH=y
CONFIG_GENERIC_386=y
# CONFIG_386 is not set
# CONFIG_486 is not set
# CONFIG_586 is not set
# CONFIG_586MMX is not set
# CONFIG_686 is not set
# CONFIG_PENTIUMII is not set
# CONFIG_PENTIUMIII is not set
# CONFIG_PENTIUM4 is not set
# CONFIG_K6 is not set
# CONFIG_K7 is not set
# CONFIG_ELAN is not set
# CONFIG_CRUSOE is not set
# CONFIG_WINCHIPC6 is not set
# CONFIG_WINCHIP2 is not set
# CONFIG_CYRIXIII is not set
# CONFIG_NEHEMIAH is not set
TARGET_SUBARCH=""
#
# Using ELF file format
#
ARCH_LITTLE_ENDIAN=y
#
# Using Little Endian
#
ARCH_HAS_MMU=y
ARCH_USE_MMU=y
UCLIBC_HAS_FLOATS=y
UCLIBC_HAS_FPU=y
DO_C99_MATH=y
KERNEL_HEADERS="/usr/include"
HAVE_DOT_CONFIG=y
UCLIBC_HAS_FENV=y

View File

@@ -1 +0,0 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

Some files were not shown because too many files have changed in this diff Show More