Commit Graph

15 Commits

Author SHA1 Message Date
Tim Orling
2841449527 bitbake: layerindexlib: fix missing layer branch backtrace
When a LayerBranch (a specific layer at a specific release) does not
exist in the layerindex database ("Layerindex Metadata"), the dependency
would throw a backtrace. Instead fail early and provide an error message.

Since layerindexlib will also check the local layers, inform the user that
a local checkout might resolve the situation. Recommend that they reach
out to the layer maintainers and layer index admins to properly fix it for
everyone.

While we are here, remove some trailing whitespace.

[YOCTO #15365]
[YOCTO #13954]

(Bitbake rev: 96cbe8f87209a927c157ebcf469f8b9d54fcf92e)

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-27 11:36:38 +00:00
Scott Murray
09a62d96c7 bitbake: lib: Replace remaining "blacklist"/"whitelist" usage
In line with the inclusive language migration defined at:

https://wiki.yoctoproject.org/wiki/Inclusive_language

replace the remaining non-backwards-compatibility related usage
of "blacklist"/"whitelist" with "allowed"/"disallowed" in a few
places as appropriate.

(Bitbake rev: f579fb8c23d2919d25641fa4234f8a1e9c06a922)

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-21 23:37:26 +00:00
Jon Mason
2e78ec95be bitbake: bitbake: replace http with https for URLs
https has been the preferred way to access websites for many years now.
Change all of the URLs with a _working_ https server/certificate to use
that URL.

(Bitbake rev: da543cdaf88a387675e25d3555765f1146e4105e)

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-08 17:04:59 +01:00
Alexander Kanavin
f7909da79f bitbake: bitbake: do not import imp in layerindexlib
The module is deprecated and unused.

(Bitbake rev: 76c9030d6c91cd776a1aa732fb92b7cd4539b503)

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-17 07:26:24 +01:00
Joshua Watt
75f87db413 bitbake: logging: Make bitbake logger compatible with python logger
The bitbake logger overrode the definition of the debug() logging call
to include a debug level, but this causes problems with code that may
be using standard python logging, since the extra argument is
interpreted differently.

Instead, change the bitbake loggers debug() call to match the python
logger call and add a debug2() and debug3() API to replace calls that
were logging to a different debug level.

[RP: Small fix to ensure bb.debug calls bbdebug()]
(Bitbake rev: f68682a79d83e6399eb403f30a1f113516575f51)

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-10 23:48:16 +00:00
Frazer Clews
abc6f864b9 bitbake: lib: fix most undefined code picked up by pylint
Correctly import, and inherit functions, and variables.
Also fix some typos and remove some Python 2 code that isn't recognised.

(Bitbake rev: b0c807be5c2170c9481c1a04d4c11972135d7dc5)

Signed-off-by: Frazer Clews <frazerleslieclews@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-25 18:14:53 +01:00
Richard Purdie
89705a60f3 bitbake: data_smart: Don't pass unneeded datastore
The datastore is already available to this function internally so don't
also try and pass the datastore as a parameter. This is clearly broken
API when you look at the existing calls to it.

This then doesn't break the planned tinfoil data connector changes.

(Bitbake rev: af1654498ee5b47368a41dad2d2b7b6abc19ff15)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-24 22:01:03 +00:00
Frazer Clews
0ac5174c7d bitbake: lib: remove unused imports
removed unused imports which made the code harder to read, and slightly
but less efficient

(Bitbake rev: 4367692a932ac135c5aa4f9f2a4e4f0150f76697)

Signed-off-by: Frazer Clews <frazer.clews@codethink.co.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-19 13:31:05 +00:00
Mark Hatle
18b8e2e104 bitbake: layerindexlib: Fix parsing of recursive layer dependencies
[YOCTO #13447]

When running bitbake-layers layerindex-fetch from 'master', there is a
circular dependency between meta-oe and meta-python.  This triggered a maximum
recursion depth exception.

To fix the exception, as we walk down a branch (depth first search), we track
the layers we've already seen.  If we are about to recurse into a layer we've
already seen we report a warning and then stop recursion.

(Bitbake rev: d6155d095513be3f500d089c4ed4c4b89949d560)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-13 09:38:26 +01:00
Richard Purdie
cf9c0be3f6 bitbake: bitbake: Drop duplicate license boilerplace text
With the introduction of SPDX-License-Identifier headers, we don't need a ton
of header boilerplate in every file. Simplify the files and rely on the top
level for the full licence text.

(Bitbake rev: 695d84397b68cc003186e22f395caa378b06bc75)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04 10:44:10 +01:00
Richard Purdie
79834a7144 bitbake: bitbake: Add initial pass of SPDX license headers to source code
This adds the SPDX-License-Identifier license headers to the majority of
our source files to make it clearer exactly which license files are under.

The bulk of the files are under GPL v2.0 with one found to be under V2.0
or later, some under MIT and some have dual license. There are some files
which are potentially harder to classify where we've imported upstream code
and those can be handled specifically in later commits.

The COPYING file is replaced with LICENSE.X files which contain the full
license texts.

(Bitbake rev: ff237c33337f4da2ca06c3a2c49699bc26608a6b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-04 10:44:04 +01:00
Mark Hatle
b33c179aa9 bitbake: layerindexlib: Fix various type checking errors
In the list_obj function, we can't check if the requested object is 'in',
the index data -- as it's actually an attribute of the object.  Move to hasattr.

The remaining items were incorrect usages of 'type' for class type comparison.
Instead move to 'isinstance'.  Remaing 'type' comparisons are still valid.  The
code was also reordered slightly to avoid a lot of:

if not isinstance(x, y):
   ...
else:
   ...

reordering it removes the not and makes the code slightly easier to read.

(Bitbake rev: cddea4282820ef10ad4863d87327891ea9383916)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-18 10:59:26 +01:00
Mark Hatle
f61ef5b454 bitbake: lib/layerindexlib/tests/restapi.py: Fix test cases when BB_SKIP_NETTETS=yes
Change the way the network related tests are skipped, based on how the
fetch tests are handled.  We introduce a 'skipIfNoNetwork()' function that
will report skipped tests through the standard unit test reporting system.

[YOCTO #12928]

(Bitbake rev: 7d5af23d560b38fb5558d4ac51c3c9611d6d904f)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-26 15:14:33 +01:00
Mark Hatle
376ed63eb9 bitbake: lib/layerindexlib/tests/cooker.py: Fix topdir to use an absolute (real) path
The test case needs to access test case files.  Different versions of python
may return absolute or relative locations in __file__.  Use the same approach
as other test cases in determining the location of the test files.

(Bitbake rev: 80fe44889a858bddaca230c2d49ccabfcbc236a3)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-26 15:14:33 +01:00
Mark Hatle
1ac19d1bf1 bitbake: layerindexlib: Initial layer index processing module implementation
The layer index module is expected to be used by various parts of the system
in order to access a layerindex-web (such as layers.openembedded.org) and
perform basic processing on the information, such as dependency scanning.

Along with the layerindex implementation are associated tests.  The tests
properly honor BB_SKIP_NETTESTS='yes' to prevent test failures.

Tests Implemented:
   - Branch, LayerItem, LayerBranch, LayerDependency, Recipe, Machine and
      Distro objects
   - LayerIndex setup using the layers.openembedded.org restapi
   - LayerIndex storing and retrieving from a file
   - LayerIndex verify dependency resolution ordering
   - LayerIndex setup using simulated cooker data

(Bitbake rev: fd0ee6c10dbb5592731e56f4c592fe687682a3e6)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-02 10:18:27 +01:00