aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/update_layer.py
diff options
context:
space:
mode:
authorAmanda Brindle <amanda.r.brindle@intel.com>2017-12-15 13:06:53 -0800
committerPaul Eggleton <paul.eggleton@linux.intel.com>2017-12-18 09:01:29 +1300
commit51e83c8d31449eb314a9d7e93545f78de2898d87 (patch)
tree26ea280d2b70c2267032ec418a75cc288331b151 /layerindex/update_layer.py
parenta64bfed81b3827503ff825090f1fb4b94e1cd9bd (diff)
downloadopenembedded-core-contrib-51e83c8d31449eb314a9d7e93545f78de2898d87.tar.gz
update_layer.py: Save and show recipe dependencies
Added a model for the PACKAGECONFIG variable, which has a one to many relationship with the Recipe model. Added models for static build dependencies and dynamic build dependencies, both of which have a many to many relationship with the Recipe model. These objects are created in update_layer.py and are displayed on the Recipe detail page. Added a depends search option for recipes, allowing users to search for recipes that depend on any particular recipe. Use "depends:recipename" in the recipe search to activate this. Fixes [YOCTO #12129] Fixes [YOCTO #11415] Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/update_layer.py')
-rw-r--r--layerindex/update_layer.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index d91c00e13e..c0fa8bc56a 100644
--- a/layerindex/update_layer.py
+++ b/layerindex/update_layer.py
@@ -57,6 +57,7 @@ def split_recipe_fn(path):
def update_recipe_file(tinfoil, data, path, recipe, layerdir_start, repodir):
fn = str(os.path.join(path, recipe.filename))
+ from layerindex.models import PackageConfig, StaticBuildDep, DynamicBuildDep
try:
logger.debug('Updating recipe %s' % fn)
if hasattr(tinfoil, 'parse_recipe_file'):
@@ -81,6 +82,43 @@ def update_recipe_file(tinfoil, data, path, recipe, layerdir_start, repodir):
recipe.blacklisted = envdata.getVarFlag('PNBLACKLIST', recipe.pn, True) or ""
recipe.save()
+ # Handle static build dependencies for this recipe
+ static_dependencies = envdata.getVar("DEPENDS", True) or ""
+ for dep in static_dependencies.split():
+ static_build_dependency = StaticBuildDep.objects.get_or_create(name=dep)
+ static_build_dependency[0].save()
+ static_build_dependency[0].recipes.add(recipe)
+
+ # Handle the PACKAGECONFIG variables for this recipe
+ package_config_VarFlags = envdata.getVarFlags("PACKAGECONFIG")
+ for key, value in package_config_VarFlags.items():
+ if key == "doc":
+ continue
+ package_config = PackageConfig()
+ package_config.feature = key
+ package_config.recipe = recipe
+ package_config_vals = value.split(",")
+ try:
+ package_config.build_deps = package_config_vals[2]
+ except IndexError:
+ pass
+ try:
+ package_config.with_option = package_config_vals[0]
+ except IndexError:
+ pass
+ try:
+ package_config.without_option = package_config_vals[1]
+ except IndexError:
+ pass
+ package_config.save()
+ # Handle the dynamic dependencies for the PACKAGECONFIG variable
+ if package_config.build_deps:
+ for dep in package_config.build_deps.split():
+ dynamic_build_dependency = DynamicBuildDep.objects.get_or_create(name=dep)
+ dynamic_build_dependency[0].save()
+ dynamic_build_dependency[0].package_configs.add(package_config)
+ dynamic_build_dependency[0].recipes.add(recipe)
+
# Get file dependencies within this layer
deps = envdata.getVar('__depends', True)
filedeps = []