Commit Graph

17 Commits

Author SHA1 Message Date
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