Commit Graph

18 Commits

Author SHA1 Message Date
Meh Mbeh Ida Delphine
2314fb2811 Add SPDX license headers to layerindex-web source files
Added SPDX identifiers to all .py files except those in migrations directory.

Fixes: [YOCTO #13527]

Signed-off-by: Meh Mbeh Ida Delphine <idadelm@gmail.com>
Signed-off-by: Paul Eggleton <bluelightning@bluelightning.org>
2021-04-21 08:22:51 +12:00
Mark Hatle
1ce4a85d25 editlayer: Be more specific on the searches
Just because git.yoctoproject.org is in the URL, doesn't mean we can or
should force the vcs_web_url to be a specific value.  If it starts with
git://git.yoctoproject.org then we can do this.  git.openembedded.org
already did this.

This also changes github, gitlab and bitbucket references.

Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-10-14 09:20:33 +13:00
Paul Eggleton
303d7ca235 Use shell=False where possible with utils.runcmd()
It's best practice for security reasons to use shell=False and pass
command line arguments as a list; it also avoids some pain with
escaping, so let's use it everywhere we can (in fact we're only left
with one place in layerindex/tasks.py where we now pass shell=True).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:31:01 +12:00
Paul Eggleton
a82ce59a52 Auto-determine web/file/tree/commit URLs for gitlab.com
I've come across at least one layer that is now hosted on gitlab.com, so
add support in the layer submission/edit form and import_layer.py for
automatically determining the other fields for gitlab.com URLs.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-10-01 15:42:59 +13:00
Robert Yang
3aa6bf964d import_layer.py: add -t option for layer_type
Now the logic is:
Use options.layer_type if specified, and guess if not. Default to 'M'.

Note choices=['A', 'B', 'S', 'D', 'M', ''], the '' is for default='', we can't
use default='M' here, otherwise we don't know whether the 'M' is specified by
user or is the default value, we don't guess if it is specified by user,
otherwise, guess.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-09-20 15:53:07 +12:00
Paul Eggleton
a6aaa5c8ef Implement layer web repo commit URL
The Recipe Reporting System needs to be able to provide links to commits
in the web interface for the repository, but we can only do this if we
have a custom template URL just like we do for file/tree links, since
it's different for different git web interfaces. Add support in all the
various places for such a URL and make use of it in the RRS.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Robert Yang
a474dae060 layerconfparse.py: remove unused layerbranch from parse_layer()
The layerbranch is not used in parse_layer(), so remove it.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-07-21 08:14:57 +02:00
Paul Eggleton
839bd48c7a layerindex: fix OpenEmbedded cgit URL
Since some recent infrastructure changes, "/cgit.cgi" should no longer
be part of cgit.openembedded.org URLs, apparently.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-16 13:57:30 +13:00
Paul Eggleton
a5a3c47b69 Fix layerconfparser lifetime handling
* Setting of the object has to be before the try: or otherwise the
  finally block can get called if that doesn't succeed with the result
  that the layerconfparser object won't have a value, which will
  trigger an exception
* We shouldn't be using the config_data object after shutting down
  tinfoil, so avoid doing that

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-01-16 13:08:18 +13:00
Liam R. Howlett
61845b7465 layerindexer: Add layer recommends support
Parse layer.conf and add dependencies that are not required from
LAYERRECOMMENDS_<name>.  Update the layerindex/template to support
recommends.  Uses bitbake parsing code & checks versions.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>

Added associated migration.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
2016-10-18 16:42:16 +13:00
Liam R. Howlett
540336edde layerindex: Detect dependencies from layer.conf files
Read dependencies from layer.conf and try to create the LayerDependency
entry by looking up the correct database object.  Dependencies are found
by layer name only - no collection support.  layer.conf parsing is
handled by the bitbake code.

Once all layers are added, the dependencies have to be rechecked in case
the layers are not added in order.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>
2016-10-18 16:42:16 +13:00
Liam R. Howlett
752e0152c2 layerindex/tools/import_layer.py: Avoid failing if there is any layer to add
Subdirectories are scanned when adding layers.  If any of the
subdirectories or root directory layers already exist in the database,
then the addition fails.  This changes that behaviour to report the
failure as a warning and remove it from the list.  That way, if a repo
has a new layer added it can be rescanned without issue.  Layers being
rescanned are checked against the vcs_url to ensure there is not a name
collision.  A name collision without the same vcs_url will still produce
a hard failure.

Note that multiple layers with the same vcs_url are supported in the
error reporting even though this should never happen.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>
2016-10-18 16:42:15 +13:00
Liam R. Howlett
4bbc210d34 layerindex/tools/import_layer.py: Sanitize layer name
Django will produce a cryptic error message if layers are added with
invalid names.  Sanitize the layer names when trying to add them.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>
2016-10-18 16:42:15 +13:00
Liam R. Howlett
aaddb1c9a5 import_layer: Add --actual-branch option
Allow users to set actual-branch from the command line import of layers.

Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com>
2016-10-18 16:42:15 +13:00
Paul Eggleton
78406e520a Fix import script for Django 1.8 & Python 3
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-09-20 20:37:45 +12:00
Paul Eggleton
29c6458dca Support (and require) Python 3
We need to be able to support Python 3 so that we can parse master of
OE-Core with bitbake (which now requires it). This now means the
interface itself and the update script require Python 3.4+.

Part of the implementation for [YOCTO #9704].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-12 11:33:08 +12:00
Paul Eggleton
7a432108c0 tools/import_layer: fix errors in maintainer scraping code
* Fix "sre_constants.error: nothing to repeat" error due to .* inside
  group made optional with ? in regex
* Avoid error if maintainer responsibility is not specified

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-06-12 11:24:25 +01:00
Paul Eggleton
47d6ab50c8 Add layer import script
Adds a simple way to add a new layer to the database in an automated
manner, given only a URL and optionally a name and subdirectory. If no
subdirectory is given, the root and all first-level subdirectories that
contain conf/layer.conf will be created as layers. Guesses will be made
as to the right values for certain fields, by looking at
README/MAINTAINERS files and github repository information.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2014-02-23 02:13:10 +00:00