1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

bitbake: toaster: Add distro selection support

Add the ability to select a distro in the project page,
based on values from the Layer Index. Add a distro selection
page with the add layer feature, based on the add machine
page.

[YOCTO #10632]

(Bitbake rev: a156a4eff67cdc3943494f5be72b96e3db656250)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
David Reyna
2017-06-27 13:44:30 -07:00
committed by Richard Purdie
parent 43aaa802c3
commit 4f2baebf36
12 changed files with 325 additions and 3 deletions
+31
View File
@@ -321,6 +321,22 @@ class Project(models.Model):
return queryset
def get_available_distros(self):
""" Returns QuerySet of all Distros which are provided by the
Layers currently added to the Project """
queryset = Distro.objects.filter(
layer_version__in=self.get_project_layer_versions())
return queryset
def get_all_compatible_distros(self):
""" Returns QuerySet of all the compatible Wind River distros available to the
project including ones from Layers not currently added """
queryset = Distro.objects.filter(
layer_version__in=self.get_all_compatible_layer_versions())
return queryset
def get_available_recipes(self):
""" Returns QuerySet of all the recipes that are provided by layers
added to this project """
@@ -1795,6 +1811,21 @@ def signal_runbuilds():
except FileNotFoundError:
logger.info("Stopping existing runbuilds: no current process found")
class Distro(models.Model):
search_allowed_fields = ["name", "description", "layer_version__layer__name"]
up_date = models.DateTimeField(null = True, default = None)
layer_version = models.ForeignKey('Layer_Version')
name = models.CharField(max_length=255)
description = models.CharField(max_length=255)
def get_vcs_distro_file_link_url(self):
path = self.name+'.conf'
return self.layer_version.get_vcs_file_link_url(path)
def __unicode__(self):
return "Distro " + self.name + "(" + self.description + ")"
django.db.models.signals.post_save.connect(invalidate_cache)
django.db.models.signals.post_delete.connect(invalidate_cache)
django.db.models.signals.m2m_changed.connect(invalidate_cache)