toaster: add switch of git and not-git layers imported
PATCH 1/9 toaster: add switch of git and not-git layers imported
From: Sujith H <[email protected]>
This patch updates the layerdetails html file to add the feature of switching imported layers between directories and git repositories.
[YOCTO #9913]
--- .../toaster/toastergui/templates/layerdetails.html | 125 +++++++++++++++++---- 1 file changed, 101 insertions(+), 24 deletions(-)
bitbake/lib/toaster/toastergui/templates/layerdetails.html +101 -24
@@ -84,11 +84,16 @@ </script> <div class="page-header"> + {% if layerversion.layer.local_source_dir %} + <h1>{{layerversion.layer.name}} <small class="commit" style="display:none;"></small> + </h1> + {% else %} <h1>{{layerversion.layer.name}} <small class="commit" {% if layerversion.get_vcs_reference|length > 13 %} data-toggle="tooltip" title="{{layerversion.get_vcs_reference}}" {% endif %}>({{layerversion.get_vcs_reference|truncatechars:13}})</small> </h1> + {% endif %} </div> <div class="row"> <!-- container for tabs -->
@@ -97,6 +102,21 @@ <button type="button" class="close" id="dismiss-alert">×</button> <span id="alert-msg"></span> </div> + + <span class="button-place"> + {% if layerversion.id not in projectlayers %} + <button id="add-remove-layer-btn" data-directive="add" class="btn btn-default btn-lg btn-block"> + <span class="glyphicon glyphicon-plus"></span> + Add the {{layerversion.layer.name}} layer to your project + </button> + {% else %} + <button id="add-remove-layer-btn" data-directive="remove" class="btn btn-default btn-block btn-lg btn-danger"> + <span class="glyphicon glyphicon-trash"></span> + Remove the {{layerversion.layer.name}} layer from your project + </button> + {% endif %} + </span> + <ul class="nav nav-tabs"> <li class="active"> <a data-toggle="tab" href="#information" id="details-tab">Layer details</a>
@@ -109,23 +129,21 @@ </li> </ul> <div class="tab-content"> - <span class="button-place"> - {% if layerversion.id not in projectlayers %} - <button id="add-remove-layer-btn" data-directive="add" class="btn btn-default btn-lg btn-block"> - <span class="glyphicon glyphicon-plus"></span> - Add the {{layerversion.layer.name}} layer to your project - </button> - {% else %} - <button id="add-remove-layer-btn" data-directive="remove" class="btn btn-default btn-block btn-lg btn-danger"> - <span class="glyphicon glyphicon-trash"></span> - Remove the {{layerversion.layer.name}} layer from your project - </button> - {% endif %} - </span> <!-- layer details pane --> <div id="information" class="tab-pane active"> - <dl class="dl-horizontal"> + {% if layerversion.layer.local_source_dir %} + <h3>Layer source code location</h3> + <dl class="dl-horizontal" id="directory-info"> + <dt> + Path to the layer directory + </dt> + <dd> + <code>{{layerversion.layer.local_source_dir}}</code> + </dd> + </dl> + {% else %} + <dl class="dl-horizontal" id="git-repo-info"> <dt class=""> <span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository"></span> Repository URL
@@ -139,11 +157,9 @@ <div class="form-group"> <input type="text" class="form-control" value="{{layerversion.layer.vcs_url}}"> </div> - <button data-layer-prop="vcs_url" class="btn btn-default change-btn" type="button">Save</button> - <a href="#" style="display:none" class="btn btn-link cancel">Cancel</a> </form> - <span class="glyphicon glyphicon-edit"></span> </dd> + {% if layerversion.dirpath %} <dt> <span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span> Repository subdirectory
@@ -158,12 +174,9 @@ <div class="form-group"> <input type="text" class="form-control" value="{{layerversion.dirpath}}"> </div> - <button data-layer-prop="dirpath" class="btn btn-default change-btn" type="button">Save</button> - <a href="#" style="display:none" class="btn btn-link cancel">Cancel</a> </form> - <span id="change-subdir" class="glyphicon glyphicon-edit"></span> - <span class="glyphicon glyphicon-trash delete-current-value" data-toggle="tooltip" title="Delete"></span> </dd> + {% endif %} <dt> <span class="glyphicon glyphicon-question-sign get-help" title="The Git branch, tag or commit"></span> Git revision
@@ -174,11 +187,75 @@ <div class="form-group"> <input type="text" class="form-control" value="{{layerversion.get_vcs_reference}}"> </div> - <button data-layer-prop="commit" class="btn btn-default change-btn" type="button">Save</button> - <a href="#" style="display:none" class="btn btn-link cancel">Cancel</a> </form> - <span class="glyphicon glyphicon-edit"></i> </dd> + </dl> + {% endif %} + {% if layerversion.layer_source == layer_source.TYPE_IMPORTED %} + <button class="btn btn-default btn-lg" id="edit-layer-source" style="margin-left:220px;">Edit layer source code location</button> + {% endif %} + <form id="edit-layer-source-form" style="display:none;"> + <fieldset> + <legend class="radioLegend">Where is the layer source code?</legend> + <div class="radio"> + <label> + <input type="radio" name="source-location" id="repo" value="repo"> + In a <strong>Git repository</strong> + </label> + <p class="help-block" style="margin-left:20px;width:70%;">To build the layer Toaster must be able to access the Git repository, otherwise builds will fail. Toaster will\ + fetch and checkout your chosen Git revision every time you start a build.</p> + </div> + <div class="radio" style="margin-top:15px;"> + <label> + <input type="radio" name="source-location" id="dir" value="dir" checked> + In a <strong>directory</strong> + </label> + <p class="help-block" style="margin-left:20px;width:70%;">Use this option for quick layer development, by simply providing the path to the layer source code.</p> + </div> + </fieldset> + + <fieldset id="layer-git"> + <legend>Git repository information</legend> + <div class="form-group"> + <label for="layer-git-repo-url"> + Git repository URL + <span class="glyphicon glyphicon-question-sign get-help" title="Fetch/clone URL of the repository. Currently, Toaster only supports Git repositories." ></span> + </label> + <input type="text" id="layer-git-repo-url" class="form-control"> + </div> + <div class="form-group"> + <label for="layer-subdir"> + Repository subdirectory + <span class="text-muted">(optional)</span> + <span class="glyphicon glyphicon-question-sign get-help" title="Subdirectory within the repository where the layer is located, if not in the root (usually only used if the repository contains more than one layer)"></span> + </label> + <input type="text" class="form-control" id="layer-subdir"> + </div> + <div class="form-group" id="layer-revision-ctrl"> + <label for="layer-git-ref">Git revision + <span class="glyphicon glyphicon-question-sign get-help" title="You can provide a Git branch, a tag or a commit SHA as the revision"></span> + </label> + <input type="text" class="form-control" id="layer-git-ref"> + <span class="help-inline" style="display:none;" id="invalid-layer-revision-hint"></span> + </div> + </fieldset> + + <fieldset id="layer-dir"> + <legend>Layer directory information</legend> + <div class="form-group"> + <label for="layer-dir-path"> + Enter the absolute path to the layer directory + </label> + <input type="text" id="layer-dir-path-in-details" class="form-control" value="{{layerversion.layer.local_source_dir}}" required> + </div> + </fieldset> + + <div style="margin-top:25px;"> + <a href="#" class="btn btn-primary btn-lg" id="save-changes-for-switch">Save changes</a> + <a href="#" class="btn btn-link btn-lg" id="cancel-changes-for-switch">Cancel</a> + </div> + </form> + <dt> <span class="glyphicon glyphicon-question-sign get-help" title="Other layers this layer depends upon"></span> Layer dependencies
Signature · 1 line
2.7.4
PATCH 4/9 toaster: layerdetails clean ups after integrating local layer changes
From: Michael Wood <[email protected]>
A few clean ups for the work done to integrate editing imported local layers into the layer detail page.
--- bitbake/lib/toaster/toastergui/api.py | 6 +- .../lib/toaster/toastergui/static/css/default.css | 2 + .../toaster/toastergui/static/js/layerdetails.js | 86 ++++++++++------------ .../toaster/toastergui/templates/layerdetails.html | 59 +++++++-------- 4 files changed, 72 insertions(+), 81 deletions(-)
bitbake/lib/toaster/toastergui/api.py +4 -2
@@ -135,7 +135,8 @@ class XhrLayer(View): Method: POST Args: - vcs_url, dirpath, commit, up_branch, summary, description, local_source_dir + vcs_url, dirpath, commit, up_branch, summary, description, + local_source_dir add_dep = append a layerversion_id as a dependency rm_dep = remove a layerversion_id as a depedency
@@ -167,7 +168,8 @@ class XhrLayer(View): if "description" in request.POST: layer_version.layer.description = request.POST["description"] if "local_source_dir" in request.POST: - layer_version.layer.local_source_dir = request.POST["local_source_dir"] + layer_version.layer.local_source_dir = \ + request.POST["local_source_dir"] if "add_dep" in request.POST: lvd = LayerVersionDependency(
bitbake/lib/toaster/toastergui/static/css/default.css +2 -0
@@ -316,6 +316,8 @@ h2.panel-title { font-size: 30px; } /* Make the help in tables insivisble until you hover over the right cell */ .hover-help { visibility: hidden; } +#add-remove-layer-btn { margin-bottom: 20px; } + /* Blue hightlight animation for tasks and directory structure tables */ .highlight { -webkit-animation: target-fade 15s 1; -moz-animation: target-fade 15s 1; animation: target-fade 15s 1; } @-webkit-keyframes target-fade { 0% { background-color: #D9EDF7; } 25% { background-color: #D9EDF7; } 100% { background-color: white; } }
bitbake/lib/toaster/toastergui/static/js/layerdetails.js +39 -47
163 lines not on this page · raw message
bitbake/lib/toaster/toastergui/templates/layerdetails.html +27 -32
106 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 7/9 toaster: tests Add selenium test layer source switching layer details page
In reply to Elliot SmithFrom: Michael Wood <[email protected]>
Add selenium tests for the new layer source switching functionality on the layer details page. Edits the values for git repository and saves and then edits the details for directory information and saves.
--- .../tests/browser/test_layerdetails_page.py | 32 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-)
bitbake/lib/toaster/tests/browser/test_layerdetails_page.py +28 -4
@@ -82,15 +82,17 @@ class TestLayerDetailsPage(SeleniumTestCase): self.get(self.url) self.click("#add-remove-layer-btn") + self.click("#edit-layer-source") + self.click("#repo") + + self.wait_until_visible("#layer-git-repo-url") # Open every edit box for btn in self.find_all("dd .glyphicon-edit"): btn.click() - self.wait_until_visible("dd input") - # Edit each value - for inputs in self.find_all("dd input[type=text]") + \ + for inputs in self.find_all("#layer-git input[type=text]") + \ self.find_all("dd textarea"): # ignore the tt inputs (twitter typeahead input) if "tt-" in inputs.get_attribute("class"):
@@ -104,16 +106,20 @@ class TestLayerDetailsPage(SeleniumTestCase): inputs.send_keys("-edited") + # Save the new values for save_btn in self.find_all(".change-btn"): save_btn.click() + self.click("#save-changes-for-switch") + self.wait_until_visible("#edit-layer-source") + # Refresh the page to see if the new values are returned self.get(self.url) new_values = ["%s-edited" % old_val for old_val in self.initial_values] - for inputs in self.find_all('dd input[type="text"]') + \ + for inputs in self.find_all('#layer-git input[type="text"]') + \ self.find_all('dd textarea'): # ignore the tt inputs (twitter typeahead input) if "tt-" in inputs.get_attribute("class"):
@@ -125,6 +131,24 @@ class TestLayerDetailsPage(SeleniumTestCase): "Expecting any of \"%s\" but got \"%s\"" % (new_values, value)) + # Now convert it to a local layer + self.click("#edit-layer-source") + self.click("#dir") + dir_input = self.wait_until_visible("#layer-dir-path-in-details") + + new_dir = "/home/test/my-meta-dir" + dir_input.send_keys(new_dir) + + self.click("#save-changes-for-switch") + self.wait_until_visible("#edit-layer-source") + + # Refresh the page to see if the new values are returned + self.get(self.url) + dir_input = self.find("#layer-dir-path-in-details") + self.assertTrue(new_dir in dir_input.get_attribute("value"), + "Expected %s in the dir value for layer directory" % + new_dir) + def test_delete_layer(self): """ Delete the layer """
Signature · 1 line
2.7.4
PATCH 9/9 toaster: localhostbecontroller Remove git assumption
In reply to Elliot SmithFrom: Michael Wood <[email protected]>
We don't need to force everyone to use git for the method in which openembedded-core is downloaded. For instance it could have been downloaded and extracted as a tarball.
--- bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +10 -4
@@ -151,11 +151,17 @@ class LocalhostBEController(BuildEnvironmentController): localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit)) logger.debug("localhostbecontroller: giturl %s:%s checking out in current directory %s" % (giturl, commit, localdirname)) - # make sure our directory is a git repository + # see if our directory is a git repository if os.path.exists(localdirname): - localremotes = self._shellcmd("git remote -v", localdirname) - if not giturl in localremotes: - raise BuildSetupException("Existing git repository at %s, but with different remotes ('%s', expected '%s'). Toaster will not continue out of fear of damaging something." % (localdirname, ", ".join(localremotes.split("\n")), giturl)) + try: + localremotes = self._shellcmd("git remote -v", + localdirname) + if not giturl in localremotes: + raise BuildSetupException("Existing git repository at %s, but with different remotes ('%s', expected '%s'). Toaster will not continue out of fear of damaging something." % (localdirname, ", ".join(localremotes.split("\n")), giturl)) + except ShellCmdException: + # our localdirname might not be a git repository + #- that's fine + pass else: if giturl in cached_layers: logger.debug("localhostbecontroller git-copying %s to %s" % (cached_layers[giturl], localdirname))
Signature · 1 line
2.7.4
PATCH 3/9 toaster: update api to include local_source_dir
In reply to Elliot SmithFrom: Sujith H <[email protected]>
Add an additional argument to the api to handle local_source_dir which is the value user passes to import non-git layers.
[YOCTO #9913]
--- bitbake/lib/toaster/toastergui/api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
bitbake/lib/toaster/toastergui/api.py +3 -1
@@ -135,7 +135,7 @@ class XhrLayer(View): Method: POST Args: - vcs_url, dirpath, commit, up_branch, summary, description + vcs_url, dirpath, commit, up_branch, summary, description, local_source_dir add_dep = append a layerversion_id as a dependency rm_dep = remove a layerversion_id as a depedency
@@ -166,6 +166,8 @@ class XhrLayer(View): layer_version.layer.summary = request.POST["summary"] if "description" in request.POST: layer_version.layer.description = request.POST["description"] + if "local_source_dir" in request.POST: + layer_version.layer.local_source_dir = request.POST["local_source_dir"] if "add_dep" in request.POST: lvd = LayerVersionDependency(
Signature · 1 line
2.7.4
PATCH 8/9 toaster: Allow git information to be null for BRLayer
In reply to Elliot SmithFrom: Michael Wood <[email protected]>
We no longer only deal with layers that have their source in a gir repository, we also allow for local directories too so update the BRLayer model to reflect this.
--- .../migrations/0007_brlayers_optional_gitinfo.py | 29 ++++++++++++++++++++++ bitbake/lib/toaster/bldcontrol/models.py | 11 ++++---- 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 bitbake/lib/toaster/bldcontrol/migrations/0007_brlayers_optional_gitinfo.py
bitbake/lib/toaster/bldcontrol/migrations/0007_brlayers_optional_gitinfo.py new file +29 -0
@@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bldcontrol', '0006_brlayer_local_source_dir'), + ] + + operations = [ + migrations.AlterField( + model_name='brlayer', + name='commit', + field=models.CharField(max_length=254, null=True), + ), + migrations.AlterField( + model_name='brlayer', + name='dirpath', + field=models.CharField(max_length=254, null=True), + ), + migrations.AlterField( + model_name='brlayer', + name='giturl', + field=models.CharField(max_length=254, null=True), + ), + ]
bitbake/lib/toaster/bldcontrol/models.py +6 -5
@@ -126,13 +126,14 @@ class BuildRequest(models.Model): # These tables specify the settings for running an actual build. # They MUST be kept in sync with the tables in orm.models.Project* + class BRLayer(models.Model): - req = models.ForeignKey(BuildRequest) - name = models.CharField(max_length = 100) - giturl = models.CharField(max_length = 254) + req = models.ForeignKey(BuildRequest) + name = models.CharField(max_length=100) + giturl = models.CharField(max_length=254, null=True) local_source_dir = models.CharField(max_length=254, null=True) - commit = models.CharField(max_length = 254) - dirpath = models.CharField(max_length = 254) + commit = models.CharField(max_length=254, null=True) + dirpath = models.CharField(max_length=254, null=True) layer_version = models.ForeignKey(Layer_Version, null=True) class BRBitbake(models.Model):
Signature · 1 line
2.7.4
PATCH 6/9 toaster: Move Custom image recipe rest api to api file
In reply to Elliot SmithFrom: Michael Wood <[email protected]>
We now have a dedicated file for the rest API so move and rework for class based views. Also clean up all flake8 identified warnings.
Remove unused imports from toastergui views.
The original work for this API was done by Elliot Smith, Ed Bartosh, Michael Wood and Dave Lerner
--- bitbake/lib/toaster/toastergui/api.py | 469 +++++++++++++++++++++++++++++++- bitbake/lib/toaster/toastergui/urls.py | 18 +- bitbake/lib/toaster/toastergui/views.py | 447 +----------------------------- 3 files changed, 482 insertions(+), 452 deletions(-)
bitbake/lib/toaster/toastergui/api.py +459 -10
@@ -16,21 +16,29 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# Please run flake8 on this file before sending patches -# Temporary home for the UI's misc API import re +import logging from orm.models import Project, ProjectTarget, Build, Layer_Version from orm.models import LayerVersionDependency, LayerSource, ProjectLayer +from orm.models import Recipe, CustomImageRecipe, CustomImagePackage +from orm.models import Layer, Target, Package, Package_Dependency from bldcontrol.models import BuildRequest from bldcontrol import bbcontroller + from django.http import HttpResponse, JsonResponse from django.views.generic import View from django.core.urlresolvers import reverse -from django.core import serializers from django.utils import timezone -from django.template.defaultfilters import date +from django.db.models import Q, F +from django.db import Error from toastergui.templatetags.projecttags import json, sectohms, get_tasks +from toastergui.templatetags.projecttags import filtered_filesizeformat + +logger = logging.getLogger("toaster") + def error_response(error): return JsonResponse({"error": error})
@@ -216,6 +224,7 @@ class XhrLayer(View): "redirect": reverse('project', args=(kwargs['pid'],)) }) + class MostRecentBuildsView(View): def _was_yesterday_or_earlier(self, completed_on): now = timezone.now()
@@ -230,13 +239,11 @@ class MostRecentBuildsView(View): """ Returns a list of builds in JSON format. """ - mrb_type = 'all' project = None project_id = request.GET.get('project_id', None) if project_id: try: - mrb_type = 'project' project = Project.objects.get(pk=project_id) except: # if project lookup fails, assume no project
@@ -245,9 +252,6 @@ class MostRecentBuildsView(View): recent_build_objs = Build.get_recent(project) recent_builds = [] - # for timezone conversion - tz = timezone.get_current_timezone() - for build_obj in recent_build_objs: dashboard_url = reverse('builddashboard', args=(build_obj.pk,)) buildtime_url = reverse('buildtime', args=(build_obj.pk,))
@@ -266,7 +270,8 @@ class MostRecentBuildsView(View): build['buildrequest_id'] = buildrequest_id build['recipes_parsed_percentage'] = \ - int((build_obj.recipes_parsed / build_obj.recipes_to_parse) * 100) + int((build_obj.recipes_parsed / + build_obj.recipes_to_parse) * 100) tasks_complete_percentage = 0 if build_obj.outcome in (Build.SUCCEEDED, Build.FAILED):
@@ -300,7 +305,8 @@ class MostRecentBuildsView(View): completed_on_template = '%H:%M' if self._was_yesterday_or_earlier(completed_on): completed_on_template = '%d/%m/%Y ' + completed_on_template - build['completed_on'] = completed_on.strftime(completed_on_template) + build['completed_on'] = completed_on.strftime( + completed_on_template) targets = [] target_objs = build_obj.get_sorted_target_list()
@@ -323,3 +329,446 @@ class MostRecentBuildsView(View): recent_builds.append(build) return JsonResponse(recent_builds, safe=False) + + +class XhrCustomRecipe(View): + """ Create a custom image recipe """ + + def post(self, request, *args, **kwargs): + """ + Custom image recipe REST API + + Entry point: /xhr_customrecipe/ + Method: POST + + Args: + name: name of custom recipe to create + project: target project id of orm.models.Project + base: base recipe id of orm.models.Recipe + + Returns: + {"error": "ok", + "url": <url of the created recipe>} + or + {"error": <error message>} + """ + # check if request has all required parameters + for param in ('name', 'project', 'base'): + if param not in request.POST: + return error_response("Missing parameter '%s'" % param) + + # get project and baserecipe objects + params = {} + for name, model in [("project", Project), + ("base", Recipe)]: + value = request.POST[name] + try: + params[name] = model.objects.get(id=value) + except model.DoesNotExist: + return error_response("Invalid %s id %s" % (name, value)) + + # create custom recipe + try: + + # Only allowed chars in name are a-z, 0-9 and - + if re.search(r'[^a-z|0-9|-]', request.POST["name"]): + return error_response("invalid-name") + + custom_images = CustomImageRecipe.objects.all() + + # Are there any recipes with this name already in our project? + existing_image_recipes_in_project = custom_images.filter( + name=request.POST["name"], project=params["project"]) + + if existing_image_recipes_in_project.count() > 0: + return error_response("image-already-exists") + + # Are there any recipes with this name which aren't custom + # image recipes? + custom_image_ids = custom_images.values_list('id', flat=True) + existing_non_image_recipes = Recipe.objects.filter( + Q(name=request.POST["name"]) & ~Q(pk__in=custom_image_ids) + ) + + if existing_non_image_recipes.count() > 0: + return error_response("recipe-already-exists") + + # create layer 'Custom layer' and verion if needed + layer = Layer.objects.get_or_create( + name=CustomImageRecipe.LAYER_NAME, + summary="Layer for custom recipes", + vcs_url="file:///toaster_created_layer")[0] + + # Check if we have a layer version already + # We don't use get_or_create here because the dirpath will change + # and is a required field + lver = Layer_Version.objects.filter(Q(project=params['project']) & + Q(layer=layer) & + Q(build=None)).last() + if lver is None: + lver, created = Layer_Version.objects.get_or_create( + project=params['project'], + layer=layer, + dirpath="toaster_created_layer") + + # Add a dependency on our layer to the base recipe's layer + LayerVersionDependency.objects.get_or_create( + layer_version=lver, + depends_on=params["base"].layer_version) + + # Add it to our current project if needed + ProjectLayer.objects.get_or_create(project=params['project'], + layercommit=lver, + optional=False) + + # Create the actual recipe + recipe, created = CustomImageRecipe.objects.get_or_create( + name=request.POST["name"], + base_recipe=params["base"], + project=params["project"], + layer_version=lver, + is_image=True) + + # If we created the object then setup these fields. They may get + # overwritten later on and cause the get_or_create to create a + # duplicate if they've changed. + if created: + recipe.file_path = request.POST["name"] + recipe.license = "MIT" + recipe.version = "0.1" + recipe.save() + + except Error as err: + return error_response("Can't create custom recipe: %s" % err) + + # Find the package list from the last build of this recipe/target + target = Target.objects.filter(Q(build__outcome=Build.SUCCEEDED) & + Q(build__project=params['project']) & + (Q(target=params['base'].name) | + Q(target=recipe.name))).last() + if target: + # Copy in every package + # We don't want these packages to be linked to anything because + # that underlying data may change e.g. delete a build + for tpackage in target.target_installed_package_set.all(): + try: + built_package = tpackage.package + # The package had no recipe information so is a ghost + # package skip it + if built_package.recipe is None: + continue + + config_package = CustomImagePackage.objects.get( + name=built_package.name) + + recipe.includes_set.add(config_package) + except Exception as e: + logger.warning("Error adding package %s %s" % + (tpackage.package.name, e)) + pass + + return JsonResponse( + {"error": "ok", + "packages": recipe.get_all_packages().count(), + "url": reverse('customrecipe', args=(params['project'].pk, + recipe.id))}) + + +class XhrCustomRecipeId(View): + """ + Set of ReST API processors working with recipe id. + + Entry point: /xhr_customrecipe/<recipe_id> + + Methods: + GET - Get details of custom image recipe + DELETE - Delete custom image recipe + + Returns: + GET: + {"error": "ok", + "info": dictionary of field name -> value pairs + of the CustomImageRecipe model} + DELETE: + {"error": "ok"} + or + {"error": <error message>} + """ + @staticmethod + def _get_ci_recipe(recipe_id): + """ Get Custom Image recipe or return an error response""" + try: + custom_recipe = \ + CustomImageRecipe.objects.get(pk=recipe_id) + return custom_recipe, None + + except CustomImageRecipe.DoesNotExist: + return None, error_response("Custom recipe with id=%s " + "not found" % recipe_id) + + def get(self, request, *args, **kwargs): + custom_recipe, error = self._get_ci_recipe(kwargs['recipe_id']) + if error: + return error + + if request.method == 'GET': + info = {"id": custom_recipe.id, + "name": custom_recipe.name, + "base_recipe_id": custom_recipe.base_recipe.id, + "project_id": custom_recipe.project.id} + + return JsonResponse({"error": "ok", "info": info}) + + def delete(self, request, *args, **kwargs): + custom_recipe, error = self._get_ci_recipe(kwargs['recipe_id']) + if error: + return error + + custom_recipe.delete() + return JsonResponse({"error": "ok"}) + + +class XhrCustomRecipePackages(View): + """ + ReST API to add/remove packages to/from custom recipe. + + Entry point: /xhr_customrecipe/<recipe_id>/packages/<package_id> + Methods: + PUT - Add package to the recipe + DELETE - Delete package from the recipe + GET - Get package information + + Returns: + {"error": "ok"} + or + {"error": <error message>} + """ + @staticmethod + def _get_package(package_id): + try: + package = CustomImagePackage.objects.get(pk=package_id) + return package, None + except Package.DoesNotExist: + return None, error_response("Package with id=%s " + "not found" % package_id) + + def _traverse_dependents(self, next_package_id, + rev_deps, all_current_packages, tree_level=0): + """ + Recurse through reverse dependency tree for next_package_id. + Limit the reverse dependency search to packages not already scanned, + that is, not already in rev_deps. + Limit the scan to a depth (tree_level) not exceeding the count of + all packages in the custom image, and if that depth is exceeded + return False, pop out of the recursion, and write a warning + to the log, but this is unlikely, suggesting a dependency loop + not caught by bitbake. + On return, the input/output arg rev_deps is appended with queryset + dictionary elements, annotated for use in the customimage template. + The list has unsorted, but unique elements. + """ + max_dependency_tree_depth = all_current_packages.count() + if tree_level >= max_dependency_tree_depth: + logger.warning( + "The number of reverse dependencies " + "for this package exceeds " + max_dependency_tree_depth + + " and the remaining reverse dependencies will not be removed") + return True + + package = CustomImagePackage.objects.get(id=next_package_id) + dependents = \ + package.package_dependencies_target.annotate( + name=F('package__name'), + pk=F('package__pk'), + size=F('package__size'), + ).values("name", "pk", "size").exclude( + ~Q(pk__in=all_current_packages) + ) + + for pkg in dependents: + if pkg in rev_deps: + # already seen, skip dependent search + continue + + rev_deps.append(pkg) + if (self._traverse_dependents(pkg["pk"], rev_deps, + all_current_packages, + tree_level+1)): + return True + + return False + + def _get_all_dependents(self, package_id, all_current_packages): + """ + Returns sorted list of recursive reverse dependencies for package_id, + as a list of dictionary items, by recursing through dependency + relationships. + """ + rev_deps = [] + self._traverse_dependents(package_id, rev_deps, all_current_packages) + rev_deps = sorted(rev_deps, key=lambda x: x["name"]) + return rev_deps + + def get(self, request, *args, **kwargs): + recipe, error = XhrCustomRecipeId._get_ci_recipe( + kwargs['recipe_id']) + if error: + return error + + # If no package_id then list all the current packages + if not kwargs['package_id']: + total_size = 0 + packages = recipe.get_all_packages().values("id", + "name", + "version", + "size") + for package in packages: + package['size_formatted'] = \ + filtered_filesizeformat(package['size']) + total_size += package['size'] + + return JsonResponse({"error": "ok", + "packages": list(packages), + "total": len(packages), + "total_size": total_size, + "total_size_formatted": + filtered_filesizeformat(total_size)}) + else: + package, error = XhrCustomRecipePackages._get_package( + kwargs['package_id']) + if error: + return error + + all_current_packages = recipe.get_all_packages() + + # Dependencies for package which aren't satisfied by the + # current packages in the custom image recipe + deps = package.package_dependencies_source.for_target_or_none( + recipe.name)['packages'].annotate( + name=F('depends_on__name'), + pk=F('depends_on__pk'), + size=F('depends_on__size'), + ).values("name", "pk", "size").filter( + # There are two depends types we don't know why + (Q(dep_type=Package_Dependency.TYPE_TRDEPENDS) | + Q(dep_type=Package_Dependency.TYPE_RDEPENDS)) & + ~Q(pk__in=all_current_packages) + ) + + # Reverse dependencies which are needed by packages that are + # in the image. Recursive search providing all dependents, + # not just immediate dependents. + reverse_deps = self._get_all_dependents(kwargs['package_id'], + all_current_packages) + total_size_deps = 0 + total_size_reverse_deps = 0 + + for dep in deps: + dep['size_formatted'] = \ + filtered_filesizeformat(dep['size']) + total_size_deps += dep['size'] + + for dep in reverse_deps: + dep['size_formatted'] = \ + filtered_filesizeformat(dep['size']) + total_size_reverse_deps += dep['size'] + + return JsonResponse( + {"error": "ok", + "id": package.pk, + "name": package.name, + "version": package.version, + "unsatisfied_dependencies": list(deps), + "unsatisfied_dependencies_size": total_size_deps, + "unsatisfied_dependencies_size_formatted": + filtered_filesizeformat(total_size_deps), + "reverse_dependencies": list(reverse_deps), + "reverse_dependencies_size": total_size_reverse_deps, + "reverse_dependencies_size_formatted": + filtered_filesizeformat(total_size_reverse_deps)}) + + def put(self, request, *args, **kwargs): + recipe, error = XhrCustomRecipeId._get_ci_recipe(kwargs['recipe_id']) + package, error = self._get_package(kwargs['package_id']) + if error: + return error + + included_packages = recipe.includes_set.values_list('pk', + flat=True) + + # If we're adding back a package which used to be included in this + # image all we need to do is remove it from the excludes + if package.pk in included_packages: + try: + recipe.excludes_set.remove(package) + return {"error": "ok"} + except Package.DoesNotExist: + return error_response("Package %s not found in excludes" + " but was in included list" % + package.name) + + else: + recipe.appends_set.add(package) + # Make sure that package is not in the excludes set + try: + recipe.excludes_set.remove(package) + except: + pass + # Add the dependencies we think will be added to the recipe + # as a result of appending this package. + # TODO this should recurse down the entire deps tree + for dep in package.package_dependencies_source.all_depends(): + try: + cust_package = CustomImagePackage.objects.get( + name=dep.depends_on.name) + + recipe.includes_set.add(cust_package) + try: + # When adding the pre-requisite package, make + # sure it's not in the excluded list from a + # prior removal. + recipe.excludes_set.remove(cust_package) + except package.DoesNotExist: + # Don't care if the package had never been excluded + pass + except: + logger.warning("Could not add package's suggested" + "dependencies to the list") + return JsonResponse({"error": "ok"}) + + def delete(self, request, *args, **kwargs): + recipe, error = XhrCustomRecipeId._get_ci_recipe(kwargs['recipe_id']) + package, error = self._get_package(kwargs['package_id']) + if error: + return error + + try: + included_packages = recipe.includes_set.values_list('pk', + flat=True) + # If we're deleting a package which is included we need to + # Add it to the excludes list. + if package.pk in included_packages: + recipe.excludes_set.add(package) + else: + recipe.appends_set.remove(package) + all_current_packages = recipe.get_all_packages() + + reverse_deps_dictlist = self._get_all_dependents( + package.pk, + all_current_packages) + + ids = [entry['pk'] for entry in reverse_deps_dictlist] + reverse_deps = CustomImagePackage.objects.filter(id__in=ids) + for r in reverse_deps: + try: + if r.id in included_packages: + recipe.excludes_set.add(r) + else: + recipe.appends_set.remove(r) + except: + pass + + return JsonResponse({"error": "ok"}) + except CustomImageRecipe.DoesNotExist: + return error_response("Tried to remove package that wasn't" + " present")
bitbake/lib/toaster/toastergui/urls.py +12 -6
@@ -199,19 +199,25 @@ urlpatterns = patterns('toastergui.views', url(r'^js-unit-tests/$', 'jsunittests', name='js-unit-tests'), # image customisation functionality - url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/(?P<package_id>\d+|)$', - 'xhr_customrecipe_packages', name='xhr_customrecipe_packages'), + url(r'^xhr_customrecipe/(?P<recipe_id>\d+)' + '/packages/(?P<package_id>\d+|)$', + api.XhrCustomRecipePackages.as_view(), + name='xhr_customrecipe_packages'), url(r'^xhr_customrecipe/(?P<recipe_id>\d+)/packages/$', - 'xhr_customrecipe_packages', name='xhr_customrecipe_packages'), + api.XhrCustomRecipePackages.as_view(), + name='xhr_customrecipe_packages'), - url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$', 'xhr_customrecipe_id', + url(r'^xhr_customrecipe/(?P<recipe_id>\d+)$', + api.XhrCustomRecipeId.as_view(), name='xhr_customrecipe_id'), - url(r'^xhr_customrecipe/', 'xhr_customrecipe', + + url(r'^xhr_customrecipe/', + api.XhrCustomRecipe.as_view(), name='xhr_customrecipe'), url(r'^xhr_buildrequest/project/(?P<pid>\d+)$', - api.XhrBuildRequest.as_view(), + api.XhrBuildRequest.as_view(), name='xhr_buildrequest'), url(r'^mostrecentbuilds$', api.MostRecentBuildsView.as_view(),
bitbake/lib/toaster/toastergui/views.py +11 -436
491 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 5/9 toaster: Fix oe-core fixture
In reply to Elliot SmithFrom: Michael Wood <[email protected]>
Due to a copy paste error we managed to get some of the wrong information in the oe fixture that provides a suggested default settings for Toaster. This meant it tested correctly when it shouldn't have. Fix:
- The use of local bitbake
- An incorrect call to realpath which didn't include its parent module.
- The field used for the local_dir of an existing openembedded-core
--- bitbake/lib/toaster/bldcontrol/localhostbecontroller.py | 10 ++++++---- .../bldcontrol/management/commands/checksettings.py | 10 ++++++---- bitbake/lib/toaster/orm/fixtures/oe-core.xml | 16 +++++++++------- bitbake/lib/toaster/orm/fixtures/poky.xml | 6 ++++++ bitbake/lib/toaster/orm/fixtures/settings.xml | 17 +++++++---------- 5 files changed, 34 insertions(+), 25 deletions(-)
bitbake/lib/toaster/bldcontrol/localhostbecontroller.py +6 -4
@@ -98,8 +98,12 @@ class LocalhostBEController(BuildEnvironmentController): # 1. get a list of repos with branches, and map dirpaths for each layer gitrepos = {} - gitrepos[(bitbake.giturl, bitbake.commit)] = [] - gitrepos[(bitbake.giturl, bitbake.commit)].append( ("bitbake", bitbake.dirpath) ) + # if we're using a remotely fetched version of bitbake add its git + # details to the list of repos to clone + if bitbake.giturl and bitbake.commit: + gitrepos[(bitbake.giturl, bitbake.commit)] = [] + gitrepos[(bitbake.giturl, bitbake.commit)].append( + ("bitbake", bitbake.dirpath)) for layer in layers: # We don't need to git clone the layer for the CustomImageRecipe
@@ -142,8 +146,6 @@ class LocalhostBEController(BuildEnvironmentController): logger.info("Using pre-checked out source for layer %s", cached_layers) - - # 3. checkout the repositories for giturl, commit in gitrepos.keys(): localdirname = os.path.join(self.be.sourcedir, self.getGitCloneDirectory(giturl, commit))
bitbake/lib/toaster/bldcontrol/management/commands/checksettings.py +6 -4
@@ -84,8 +84,9 @@ class Command(NoArgsCommand): print("Loading OE-Core configuration") call_command("loaddata", "oe-core") if template_conf: - oe_core_path = os.realpath(template_conf + - "/../") + oe_core_path = os.path.realpath( + template_conf + + "/../") else: print("TEMPLATECONF not found. You may have to" " manually configure layer paths")
@@ -94,8 +95,9 @@ class Command(NoArgsCommand): "layer: ") # Update the layer instances of openemebedded-core for layer in Layer.objects.filter( - name="openembedded-core"): - layer.local_source_dir = oe_core_path + name="openembedded-core", + local_source_dir="OE-CORE-LAYER-DIR"): + layer.local_path = oe_core_path layer.save() # Import the custom fixture if it's present
bitbake/lib/toaster/orm/fixtures/oe-core.xml +9 -7
@@ -1,17 +1,19 @@ <?xml version="1.0" encoding="utf-8"?> <django-objects version="1.0"> + <!-- Set the project default value for DISTRO --> + <object model="orm.toastersetting" pk="1"> + <field type="CharField" name="name">DEFCONF_DISTRO</field> + <field type="CharField" name="value">nodistro</field> + </object> + <!-- Bitbake versions which correspond to the metadata release --> <object model="orm.bitbakeversion" pk="1"> <field type="CharField" name="name">master</field> <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field> <field type="CharField" name="branch">master</field> - <field type="CharField" name="dirpath">bitbake</field> </object> <object model="orm.bitbakeversion" pk="2"> <field type="CharField" name="name">HEAD</field> - <field type="CharField" name="giturl">git://git.openembedded.org/bitbake</field> - <field type="CharField" name="branch">HEAD</field> - <field type="CharField" name="dirpath">bitbake</field> </object> <!-- Releases available -->
@@ -43,15 +45,15 @@ <!-- TYPE_LOCAL = 0 Layers for the Local release --> <object model="orm.layer" pk="1"> <field type="CharField" name="name">openembedded-core</field> - <field type="CharField" name="layer_index_url"></field> <field type="CharField" name="vcs_url">git://git.openembedded.org/openembedded-core</field> </object> <object model="orm.layer_version" pk="1"> <field rel="ManyToOneRel" to="orm.layer" name="layer">1</field> - <field type="IntegerField" name="layer_source">0</field> <field rel="ManyToOneRel" to="orm.release" name="release">2</field> + <field type="CharField" name="local_path">OE-CORE-LAYER-DIR</field> <field type="CharField" name="branch">HEAD</field> - <field type="CharField" name="commit">HEAD</field> + <field type="CharField" name="dirpath">meta</field> + <field type="IntegerField" name="layer_source">0</field> </object> </django-objects>
bitbake/lib/toaster/orm/fixtures/poky.xml +6 -0
@@ -1,5 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <django-objects version="1.0"> + <!-- Set the project default value for DISTRO --> + <object model="orm.toastersetting" pk="1"> + <field type="CharField" name="name">DEFCONF_DISTRO</field> + <field type="CharField" name="value">poky</field> + </object> + <!-- Bitbake versions which correspond to the metadata release --> <object model="orm.bitbakeversion" pk="1"> <field type="CharField" name="name">master</field>
bitbake/lib/toaster/orm/fixtures/settings.xml +7 -10
@@ -1,34 +1,31 @@ <?xml version="1.0" encoding="utf-8"?> <django-objects version="1.0"> <!-- Default project settings --> - <object model="orm.toastersetting" pk="1"> + <!-- pk=1 is DISTRO --> + <object model="orm.toastersetting" pk="2"> <field type="CharField" name="name">DEFAULT_RELEASE</field> <field type="CharField" name="value">master</field> </object> - <object model="orm.toastersetting" pk="2"> + <object model="orm.toastersetting" pk="3"> <field type="CharField" name="name">DEFCONF_PACKAGE_CLASSES</field> <field type="CharField" name="value">package_rpm</field> </object> - <object model="orm.toastersetting" pk="3"> + <object model="orm.toastersetting" pk="4"> <field type="CharField" name="name">DEFCONF_MACHINE</field> <field type="CharField" name="value">qemux86</field> </object> - <object model="orm.toastersetting" pk="4"> + <object model="orm.toastersetting" pk="5"> <field type="CharField" name="name">DEFCONF_SSTATE_DIR</field> <field type="CharField" name="value">${TOPDIR}/../sstate-cache</field> </object> - <object model="orm.toastersetting" pk="5"> + <object model="orm.toastersetting" pk="6"> <field type="CharField" name="name">DEFCONF_IMAGE_INSTALL_append</field> <field type="CharField" name="value"></field> </object> - <object model="orm.toastersetting" pk="6"> + <object model="orm.toastersetting" pk="7"> <field type="CharField" name="name">DEFCONF_IMAGE_FSTYPES</field> <field type="CharField" name="value">ext3 jffs2 tar.bz2</field> </object> - <object model="orm.toastersetting" pk="7"> - <field type="CharField" name="name">DEFCONF_DISTRO</field> - <field type="CharField" name="value">poky</field> - </object> <object model="orm.toastersetting" pk="8"> <field type="CharField" name="name">DEFCONF_DL_DIR</field> <field type="CharField" name="value">${TOPDIR}/../downloads</field>
Signature · 1 line
2.7.4
PATCH 2/9 toaster: layerdetails js changes for switching layers
In reply to Elliot SmithFrom: Sujith H <[email protected]>
This patch helps to implement the switching of layers between directories and git repositories. Specifically selection of git and local directory. Also enabling form to view the selection.
[YOCTO #9913]
--- .../toaster/toastergui/static/js/layerdetails.js | 98 ++++++++++++++++++++++ 1 file changed, 98 insertions(+)
bitbake/lib/toaster/toastergui/static/js/layerdetails.js +98 -0
@@ -10,6 +10,7 @@ function layerDetailsPageInit (ctx) { var targetTab = $("#targets-tab"); var machineTab = $("#machines-tab"); var detailsTab = $("#details-tab"); + var editLayerSource = $("#edit-layer-source"); /* setup the dependencies typeahead */ libtoaster.makeTypeahead(layerDepInput, libtoaster.ctx.layersTypeAheadUrl, { include_added: "true" }, function(item){
@@ -423,4 +424,101 @@ function layerDetailsPageInit (ctx) { $(".glyphicon-trash").tooltip(); $(".commit").tooltip(); + editLayerSource.click(function() { + // Kindly bring the git layers imported from layerindex to normal page and not this new page :( + $(this).hide(); + $("#save-changes-for-switch").attr("disabled", "disabled"); + + $("#git-repo-info", "#directory-info").hide(); + $("#edit-layer-source-form").fadeIn(); + if ($("#layer-dir-path-in-details").val() == "") { + //Local dir path is empty... + $("#repo").prop("checked", true); + $("#layer-git").fadeIn(); + $("#layer-dir").hide(); + } else { + $("#layer-git").hide(); + $("#layer-dir").fadeIn(); + } + }); + + $('input:radio[name="source-location"]').change(function() { + if ($('input[name=source-location]:checked').val() == "repo") { + $("#layer-git").fadeIn(); + $("#layer-dir").hide(); + if ($("#layer-git-repo-url").val().length === 0 && $("#layer-git-ref").val().length === 0) { + $("#save-changes-for-switch").attr("disabled", "disabled"); + } + } else { + $("#layer-dir").fadeIn(); + $("#layer-git").hide(); + } + }); + + $("#layer-dir-path-in-details").keyup(function() { + $("#save-changes-for-switch").removeAttr("disabled"); + }); + + $("#layer-git-repo-url").keyup(function() { + if ($("#layer-git-repo-url").val().length > 0 && $("#layer-git-ref").val().length > 0) { + $("#save-changes-for-switch").removeAttr("disabled"); + } + }); + + $("#layer-git-ref").keyup(function() { + if ($("#layer-git-repo-url").val().length > 0 && $("#layer-git-ref").val().length > 0) { + $("#save-changes-for-switch").removeAttr("disabled"); + } + }); + + $('#cancel-changes-for-switch').click(function() { + editLayerSource.show(); + $("#git-repo-info", "#directory-info").fadeIn(); + $("#edit-layer-source-form").fadeOut(); + + if ($("#layer-dir-path-in-details").val().length) { + $("#dir").prop("checked", true); + $("#layer-git").fadeOut(); + $("#layer-dir").fadeIn(); + } else { + $("#layer-git").fadeIn(); + $("#layer-dir").fadeOut(); + } + }); + + $('#save-changes-for-switch').click(function() { + + var layerData = { + vcs_url: $('#layer-git-repo-url').val(), + commit: $('#layer-git-ref').val(), + dirpath: $('#layer-subdir').val(), + local_source_dir: $('#layer-dir-path-in-details').val(), + }; + + if ($('input[name=source-location]:checked').val() == "repo") { + layerData.local_source_dir = ""; + } else { + layerData.vcs_url = ""; + layerData.git_ref = ""; + } + + $.ajax({ + type: "POST", + url: ctx.xhrUpdateLayerUrl, + data: layerData, + headers: { 'X-CSRFToken' : $.cookie('csrftoken')}, + success: function (data) { + if (data.error != "ok") { + console.warn(data.error); + } else { + /* success layer property changed */ + window.location.reload(); + } + }, + error: function (data) { + console.warn("Call failed"); + console.warn(data); + } + }); + }); }
Signature · 1 line
2.7.4
Re: [PATCH 8/9] toaster: Allow git information to be null for BRLayer
In reply to Elliot SmithHi,
Seems like the migration changes are not merged upstream. Only models changes are there.
Thanks,
Sujith H
Quoted 88 lines · Elliot Smith
From: Michael Wood <[email protected]>
We no longer only deal with layers that have their source in a gir repository, we also allow for local directories too so update the BRLayer model to reflect this.
Signed-off-by Michael Wood <[email protected]>Signed-off-by Elliot Smith <[email protected]>--- .../migrations/0007_brlayers_optional_gitinfo.py | 29 ++++++++++++++++++++++ bitbake/lib/toaster/bldcontrol/models.py | 11 ++++---- 2 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 bitbake/lib/toaster/bldcontrol/migrations/0007_
brlayers_optional_gitinfo.pybitbake/lib/toaster/bldcontrol/migrations/0007_ renamed from bitbake/lib/toaster/bldcontrol/migrations/0007_brlayers_optional_gitinfo.py +0
-0
brlayers_optional_gitinfo.py
new file mode 100644
index 0000000..4be42a4bitbake/lib/toaster/bldcontrol/migrations/0007_ new file +0
-0
brlayers_optional_gitinfo.pybitbake/lib/toaster/bldcontrol/migrations/0007_ new file +29
-0@@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('bldcontrol', '0006_brlayer_local_source_dir'), + ] + + operations = [ + migrations.AlterField( + model_name='brlayer', + name='commit', + field=models.CharField(max_length=254, null=True), + ), + migrations.AlterField( + model_name='brlayer', + name='dirpath', + field=models.CharField(max_length=254, null=True), + ), + migrations.AlterField( + model_name='brlayer', + name='giturl', + field=models.CharField(max_length=254, null=True), + ), + ]bitbake/lib/toaster/bldcontrol/models.py +6
-6@@ -126,13 +126,14 @@ class BuildRequest(models.Model): # These tables specify the settings for running an actual build. # They MUST be kept in sync with the tables in orm.models.Project* + class BRLayer(models.Model): - req = models.ForeignKey(BuildRequest) - name = models.CharField(max_length = 100) - giturl = models.CharField(max_length = 254) + req = models.ForeignKey(BuildRequest) + name = models.CharField(max_length=100) + giturl = models.CharField(max_length=254, null=True) local_source_dir = models.CharField(max_length=254, null=True) - commit = models.CharField(max_length = 254) - dirpath = models.CharField(max_length = 254) + commit = models.CharField(max_length=254, null=True) + dirpath = models.CharField(max_length=254, null=True) layer_version = models.ForeignKey(Layer_Version, null=True) class BRBitbake(models.Model): --2.7.4
--
_______________________________________________
bitbake-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/bitbake-devel
Signature · 7 lines
സുജിത് ഹരിദാസന് Bangalore <Project>Contributor to KDE project <Project>Contributor to Yocto project http://fci.wikia.com/wiki/Anti-DRM-Campaign <Blog> http://sujithh.info C-x C-c