Track SRCREV for each recipe

For the purposes of the branch comparison function I'm about to add it
would be useful to track the value of SRCREV, so we can see if it has
changed even if PV hasn't.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2019-10-21 10:15:22 +13:00
parent 1ce4a85d25
commit 73656432b2
4 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-10-20 22:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('layerindex', '0042_recipe_pe_pr'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='srcrev',
field=models.CharField(blank=True, max_length=64),
),
]

View File

@ -475,6 +475,7 @@ class Recipe(models.Model):
updated = models.DateTimeField(auto_now=True) updated = models.DateTimeField(auto_now=True)
blacklisted = models.CharField(max_length=255, blank=True) blacklisted = models.CharField(max_length=255, blank=True)
configopts = models.CharField(max_length=4096, blank=True) configopts = models.CharField(max_length=4096, blank=True)
srcrev = models.CharField(max_length=64, blank=True)
def vcs_web_url(self): def vcs_web_url(self):
url = self.layerbranch.file_url(os.path.join(self.filepath, self.filename)) url = self.layerbranch.file_url(os.path.join(self.filepath, self.filename))

View File

@ -110,6 +110,10 @@ def update_recipe_file(tinfoil, data, path, recipe, layerdir_start, repodir, sto
recipe.pv = envdata.getVar("PV", True) recipe.pv = envdata.getVar("PV", True)
recipe.pr = envdata.getVar("PR", True) or "" recipe.pr = envdata.getVar("PR", True) or ""
recipe.pe = envdata.getVar("PE", True) or "" recipe.pe = envdata.getVar("PE", True) or ""
recipe.srcrev = envdata.getVar('SRCREV', True) or ''
if recipe.srcrev == 'INVALID':
# INVALID is the default from bitbake.conf, but we don't want to see it
recipe.srcrev = ''
recipe.summary = envdata.getVar("SUMMARY", True) recipe.summary = envdata.getVar("SUMMARY", True)
recipe.description = envdata.getVar("DESCRIPTION", True) recipe.description = envdata.getVar("DESCRIPTION", True)
recipe.section = envdata.getVar("SECTION", True) recipe.section = envdata.getVar("SECTION", True)

View File

@ -54,7 +54,7 @@
</tr> </tr>
<tr> <tr>
<th>Version</th> <th>Version</th>
<td>{{ recipe.pv }}</td> <td>{{ recipe.pv }}{% if recipe.srcrev %} ({{ recipe.srcrev }}){% endif %}</td>
</tr> </tr>
<tr> <tr>
<th>Summary</th> <th>Summary</th>