This change is to report PE (epoch) and PR (release) values for recipes from 
the bitbake cooker. These values will be reflected in the Rest API and will not 
be exposed on the UI. The aim of this change is to enrich metadata availability 
to consumers of the feed.
`
Signed-off-by: Pranay Mankad <pranayman...@gmail.com>
---
 .../migrations/0042_recipe_property_addition.py      | 20 ++++++++++++++++++++
 layerindex/models.py                                 |  2 ++
 layerindex/update_layer.py                           |  2 ++
 3 files changed, 24 insertions(+)
 create mode 100644 layerindex/migrations/0042_recipe_property_addition.py

diff --git a/layerindex/migrations/0042_recipe_property_addition.py 
b/layerindex/migrations/0042_recipe_property_addition.py
new file mode 100644
index 0000000..5583696
--- /dev/null
+++ b/layerindex/migrations/0042_recipe_property_addition.py
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.24 on 2019-09-24 21:34
+from __future__ import unicode_literals
+from django.db import migrations, models
+class Migration(migrations.Migration):
+    dependencies = [
+        ('layerindex', '0041_recipe_configopts'),
+    ]
+    operations = [
+        migrations.AddField(
+            model_name='recipe',
+            name='pe',
+            field=models.CharField(blank=True, max_length=100),
+        ),
+        migrations.AddField(
+            model_name='recipe',
+            name='pr',
+            field=models.CharField(blank=True, max_length=100),
+        ),
+    ]
diff --git a/layerindex/models.py b/layerindex/models.py
index 0ca7c06..332ba39 100644
--- a/layerindex/models.py
+++ b/layerindex/models.py
@@ -461,6 +461,8 @@ class Recipe(models.Model):
     filepath = models.CharField(max_length=255, blank=True)
     pn = models.CharField(max_length=100, blank=True)
     pv = models.CharField(max_length=100, blank=True)
+    pr = models.CharField(max_length=100, blank=True)
+    pe = models.CharField(max_length=100, blank=True)
     summary = models.CharField(max_length=200, blank=True)
     description = models.TextField(blank=True)
     section = models.CharField(max_length=100, blank=True)
diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py
index 9dc395f..7131d70 100644
--- a/layerindex/update_layer.py
+++ b/layerindex/update_layer.py
@@ -108,6 +108,8 @@ def update_recipe_file(tinfoil, data, path, recipe, 
layerdir_start, repodir, sto
         envdata.setVar('SRCPV', 'X')
         recipe.pn = envdata.getVar("PN", True)
         recipe.pv = envdata.getVar("PV", True)
+        recipe.pr = envdata.getVar("PR", True) or ""
+        recipe.pe = envdata.getVar("PE", True) or ""
         recipe.summary = envdata.getVar("SUMMARY", True)
         recipe.description = envdata.getVar("DESCRIPTION", True)
         recipe.section = envdata.getVar("SECTION", True)
-- 
2.15.1

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to