aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/update_layer.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2018-01-09 09:46:40 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2018-05-04 23:57:53 +1200
commitebceecb7fd91714e8925c4fbcc05ccdf8012181d (patch)
treeb027ed88181657cb4a5cdc1acc955008b924dbf3 /layerindex/update_layer.py
parentc183b360ff07673f00d0f4f224ced3c46fd87381 (diff)
downloadopenembedded-core-contrib-ebceecb7fd91714e8925c4fbcc05ccdf8012181d.tar.gz
Save recipe source URLs
Save each remote SRC_URI so we can use these for the recipe reporting system. This replaces an earlier implementation in the rrs branch where we simply stored SRC_URI verbatim. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/update_layer.py')
-rw-r--r--layerindex/update_layer.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index 69ca3c64ce..ecb7cbf9d7 100644
--- a/layerindex/update_layer.py
+++ b/layerindex/update_layer.py
@@ -59,7 +59,7 @@ def update_recipe_file(tinfoil, data, path, recipe, layerdir_start, repodir):
from django.db import DatabaseError
fn = str(os.path.join(path, recipe.filename))
- from layerindex.models import PackageConfig, StaticBuildDep, DynamicBuildDep
+ from layerindex.models import PackageConfig, StaticBuildDep, DynamicBuildDep, Source
try:
logger.debug('Updating recipe %s' % fn)
if hasattr(tinfoil, 'parse_recipe_file'):
@@ -92,6 +92,19 @@ def update_recipe_file(tinfoil, data, path, recipe, layerdir_start, repodir):
static_build_dependency.save()
static_build_dependency.recipes.add(recipe)
+ # Handle sources
+ old_urls = list(recipe.source_set.values_list('url', flat=True))
+ for url in (envdata.getVar('SRC_URI', True) or '').split():
+ if not url.startswith('file://'):
+ url = url.split(';')[0]
+ if url in old_urls:
+ old_urls.remove(url)
+ else:
+ src = Source(recipe=recipe, url=url)
+ src.save()
+ for url in old_urls:
+ recipe.source_set.filter(url=url).delete()
+
# Handle the PACKAGECONFIG variables for this recipe
PackageConfig.objects.filter(recipe=recipe).delete()
package_config_VarFlags = envdata.getVarFlags("PACKAGECONFIG")