mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
Record configure options
Record the configure script options when importing recipe / package information so we can display them. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
49bb85c944
commit
6deed03a1c
20
layerindex/migrations/0041_recipe_configopts.py
Normal file
20
layerindex/migrations/0041_recipe_configopts.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.11.16 on 2019-04-15 00:18
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('layerindex', '0038_patch_striplevel'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='recipe',
|
||||||
|
name='configopts',
|
||||||
|
field=models.CharField(blank=True, max_length=4096),
|
||||||
|
),
|
||||||
|
]
|
|
@ -472,6 +472,7 @@ class Recipe(models.Model):
|
||||||
inherits = models.CharField(max_length=255, blank=True)
|
inherits = models.CharField(max_length=255, blank=True)
|
||||||
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)
|
||||||
|
|
||||||
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))
|
||||||
|
|
|
@ -50,6 +50,7 @@ def update_recipe_file(path, recipe, repodir, raiseexceptions=False):
|
||||||
# At the end of the day we are scraping the spec file, we aren't trying to build it
|
# At the end of the day we are scraping the spec file, we aren't trying to build it
|
||||||
|
|
||||||
pnum_re = re.compile('-p[\s]*([0-9]+)')
|
pnum_re = re.compile('-p[\s]*([0-9]+)')
|
||||||
|
configure_re = re.compile('[/%]configure\s')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
logger.debug('Updating recipe %s' % path)
|
logger.debug('Updating recipe %s' % path)
|
||||||
|
@ -199,9 +200,17 @@ def update_recipe_file(path, recipe, repodir, raiseexceptions=False):
|
||||||
reading = True
|
reading = True
|
||||||
inprep = False
|
inprep = False
|
||||||
applyextra = []
|
applyextra = []
|
||||||
|
configopts = ''
|
||||||
|
inconf = False
|
||||||
for line in f:
|
for line in f:
|
||||||
if line.startswith('%build'):
|
if inconf:
|
||||||
# Assume it's OK to stop when we hit %build
|
line = line.rstrip()
|
||||||
|
configopts += line.rstrip('\\')
|
||||||
|
if not line.endswith('\\'):
|
||||||
|
inconf = False
|
||||||
|
continue
|
||||||
|
if line.startswith('%install'):
|
||||||
|
# Assume it's OK to stop when we hit %install
|
||||||
break
|
break
|
||||||
if line.startswith('%autopatch') or line.startswith('%autosetup'):
|
if line.startswith('%autopatch') or line.startswith('%autosetup'):
|
||||||
pnum = pnum_re.search(line)
|
pnum = pnum_re.search(line)
|
||||||
|
@ -266,6 +275,21 @@ def update_recipe_file(path, recipe, repodir, raiseexceptions=False):
|
||||||
else:
|
else:
|
||||||
patchid = int(patchsplit[0][6:])
|
patchid = int(patchsplit[0][6:])
|
||||||
applypatches[patchid] = ' '.join(patchsplit[1:])
|
applypatches[patchid] = ' '.join(patchsplit[1:])
|
||||||
|
elif line.startswith('%cmake'):
|
||||||
|
if line.rstrip().endswith('\\'):
|
||||||
|
inconf = True
|
||||||
|
configopts = line[7:].rstrip().rstrip('\\')
|
||||||
|
continue
|
||||||
|
elif configure_re.search(line):
|
||||||
|
if line.rstrip().endswith('\\'):
|
||||||
|
inconf = True
|
||||||
|
configopts = line.split('configure', 1)[1].rstrip().rstrip('\\')
|
||||||
|
continue
|
||||||
|
elif line.startswith('meson'):
|
||||||
|
if line.rstrip().endswith('\\'):
|
||||||
|
inconf = True
|
||||||
|
configopts = line[6:].rstrip().rstrip('\\')
|
||||||
|
continue
|
||||||
elif line.startswith('%prep'):
|
elif line.startswith('%prep'):
|
||||||
inprep = True
|
inprep = True
|
||||||
continue
|
continue
|
||||||
|
@ -311,6 +335,8 @@ def update_recipe_file(path, recipe, repodir, raiseexceptions=False):
|
||||||
elif key.startswith('source'):
|
elif key.startswith('source'):
|
||||||
sources.append(expand(value))
|
sources.append(expand(value))
|
||||||
|
|
||||||
|
recipe.configopts = utils.squashspaces(configopts)
|
||||||
|
|
||||||
if desc and desc[0][0] in string.printable:
|
if desc and desc[0][0] in string.printable:
|
||||||
recipe.description = expand(' '.join(desc).rstrip())
|
recipe.description = expand(' '.join(desc).rstrip())
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -121,6 +121,12 @@ def update_recipe_file(tinfoil, data, path, recipe, layerdir_start, repodir, sto
|
||||||
lr = set(envdata.getVar("__inherit_cache", True) or [])
|
lr = set(envdata.getVar("__inherit_cache", True) or [])
|
||||||
recipe.inherits = ' '.join(sorted({os.path.splitext(os.path.basename(r))[0] for r in lr if r not in gr}))
|
recipe.inherits = ' '.join(sorted({os.path.splitext(os.path.basename(r))[0] for r in lr if r not in gr}))
|
||||||
recipe.blacklisted = envdata.getVarFlag('PNBLACKLIST', recipe.pn, True) or ""
|
recipe.blacklisted = envdata.getVarFlag('PNBLACKLIST', recipe.pn, True) or ""
|
||||||
|
for confvar in ['EXTRA_OEMESON', 'EXTRA_OECMAKE', 'EXTRA_OESCONS', 'EXTRA_OECONF']:
|
||||||
|
recipe.configopts = envdata.getVar(confvar, True) or ""
|
||||||
|
if recipe.configopts:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
recipe.configopts = ''
|
||||||
recipe.save()
|
recipe.save()
|
||||||
|
|
||||||
# Handle sources
|
# Handle sources
|
||||||
|
|
|
@ -206,6 +206,19 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tr></tbody>
|
</tr></tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<h2>configure options</h2>
|
||||||
|
<table width="100%" class="table table-bordered">
|
||||||
|
<thead>
|
||||||
|
<th width="50%">{{ layerbranch_desc }}{{ layerbranch_addtext }}</th>
|
||||||
|
<th width="50%">{{ to_desc }}</th>
|
||||||
|
</thead>
|
||||||
|
<tbody><tr>
|
||||||
|
{% for rcp in recipes %}
|
||||||
|
<td><code>{{ rcp.configopts }}</code></td>
|
||||||
|
{% endfor %}
|
||||||
|
</tr></tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user