Commit Graph

25 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
Paul Eggleton
9561cce55e RRS: do not ignore non-numeric characters in versions
The regex we were using here explicitly only matched numeric characters
in version numbers - presumably the assumption was that any non-numeric
characters were not significant. However, for upstream projects such as
OpenSSL and BIND for example, alphabetic characters are an explicit part
of the version number, so if we ignore them then we miss detecting most
of the upgrades. Fix the regex so that that doesn't happen.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-11-21 02:51:30 +13:00
Paul Eggleton
869ebec108 RRS: exclude lib/ subdirectory of layers to avoid picking up templates
We were picking up lib/bblayers/example.bb in OE-Core, and it's possible
we might add similar templates in future. There shouldn't ever be files
we're interested in under lib/, and in the absence of the ability to
follow BBFILES, just exclude the directory explicitly.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-11-21 02:27:39 +13:00
Paul Eggleton
d328e392d2 update: fix error on LAYERRECOMMENDS failure
The code in recipeparse.setup_layer() was trying to log a warning in the
case where LAYERRECOMMENDS not being satisfied, however there is no
actual logger object in this context. Pass it in via a parameter and
update all callers to pass it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-10-01 11:43:52 +13:00
Paul Eggleton
7954acad9f Disable git interactive password prompts
We do not want to be prompting the user for a password during layer
updates or upstream checks, e.g. in the case where a repo requires
authentication, or on github where any fetch of a nonexistent repo
apparently triggers authentication.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-09-06 11:08:43 +12:00
Paul Eggleton
70084bd48d rrs/tools: ensure recipe parsing code deletes temporary dir
load_recipes() was leaving files around in /tmp; on my Fedora system
this eventually resulted in /tmp running out of space which we do not
want.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
add075ae00 rrs/tools/common.py: ensure we pass a string to loadDataFull()
We're calling translate() on the string deep in the bowels of the
parsing code and that doesn't work well if the string is unicode, so
convert it to a plain string first. That won't work well if the filename
is unicode but the chances of that with a recipe is pretty small I would
think.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
0aa4b93d18 rrs/tools: drop update_repo()
This function is no longer needed - we now rely upon the layer index's
code to do this (update through the update script, and checkout through
setup_layer()).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
034d66ab5a rrs/tools: print debug message when parsing recipes
Without this it's not clear what's happening if debug mode is enabled
and you are waiting for the parsing step.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:53 +12:00
Paul Eggleton
33e3dee9e7 rrs/tools/common.py: import sys/os at top
These are common enough that they should be imported up front.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:52 +12:00
Paul Eggleton
fd786875c3 rrs/tools: add dry-run option to each script
Add the ability to run the scripts without writing changes back to the
database, for debugging purposes.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
fbe5857877 rrs/tools/common.py: Fix typo when load recipes
[YOCTO #10863]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
d13329be1d rrs/tools: Upgrade to use new API of tinfoil
The new client/server API of tinfoil requires explicit call of
shutdown method to send the event for finalize cooker process.

[YOCTO #10863]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
818288f17c rrs/tools/common.py: When load a recipe use tinfoil cache
Due to multi-configuration builds in bitbake now is needed
to use a tinfoil cache instance instead of call directly in
bb.cache.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
34be7b80c2 rrs/tools/common.py: common_setup() Add layerindex to the path.
Add explicity layerindex folder to the path for avoid errors
in imports.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
6b8cfecf48 layerindex,rrs: Minor changes to work with python3.
[YOCTO #9746]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
e81daf2e0f rrs/tools: get_recipe_pv_without_srcrev add support for discard prefixes
Avoid version prefixes like v|r into all versions.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
d745458018 rrs/tools: Convert unicode strings from Django models to strings.
bb.cache.Cache.loadDatafull() expects an filepath in asciii, if not
is provided it fails with character mapping error.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
72cc4f72ba rrs/tools/common.py: Add import of FetchError and display parse errors
Import of FetchError when try to expand PV somethings requires to have
SRCREV/SRCPV causing an FetcherError.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
ec0ae0dc29 rrs/tools.py: Create standalone get_recipe_pv_without_srcpv function.
Copied get_recipe_pv_without_srcpv from oe-core/recipeutils library
to avoid import errors caused by have imported twice oe-core from poky
and from tinfoil.

rrs/tools/rrs_upgrade_history.py: Update to use get_recipe_pv_without_srcpv
from common.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
115bd943d9 rrs/tools/common.py: Handle exception when load_recipes caused by expand PV variable.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
669d58d191 rrs/tools/common.py: Add get_logger function.
get_logger function creates a stream logger and a rotate
file logger to store logs.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
a04ce69942 rrs/tools/common.py: Add load_recipes function.
load_recipes function setup tinfoil and parses recipe for given
directory.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
1208f6bc67 rrs/tools/common.py: Add get_pv_type function.
get_pv_type returns the type of pv can be git, svn, hg,
etc.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00
Aníbal Limón
31c2120edd rrs/tools/common.py: Add library with common functionality.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2018-05-04 23:57:52 +12:00