All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH v6 36/41] toaster: update view to support DL_DIR and SSTATE_DIR
Date: Wed, 23 Mar 2016 10:15:27 +0200	[thread overview]
Message-ID: <977fc336a1e0fcc57e2f01cb7aca751710de5306.1458720709.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1458720709.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1458720709.git.ed.bartosh@linux.intel.com>

From: Sujith H <sujith.h@gmail.com>

Update toaster's views.py to support DL_DIR and SSTATE_DIR for
page projectconf.html. Removed DL_DIR and SSTATE_DIR from
blacklist. Initial value of DL_DIR and SSTATE_DIR comes from
BuildEnvironment.

[YOCTO #8422]

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/toaster/toastergui/views.py | 40 +++++++++++++++++++++++++++++++--
 1 file changed, 38 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 15760b3..5cfaf16 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -45,6 +45,7 @@ from django.utils import formats
 from toastergui.templatetags.projecttags import json as jsonfilter
 from decimal import Decimal
 import json
+import os
 from os.path import dirname
 from functools import wraps
 import itertools
@@ -1875,6 +1876,7 @@ def managedcontextprocessor(request):
 import toastermain.settings
 
 from orm.models import Project, ProjectLayer, ProjectTarget, ProjectVariable
+from bldcontrol.models import  BuildEnvironment
 
 # we have a set of functions if we're in managed mode, or
 # a default "page not available" simple functions for interactive mode
@@ -2177,6 +2179,10 @@ if True:
             except ProjectVariable.DoesNotExist:
                 pass
             try:
+                return_data['dl_dir'] = ProjectVariable.objects.get(project = prj, name = "DL_DIR").value,
+            except ProjectVariable.DoesNotExist:
+                pass
+            try:
                 return_data['fstypes'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value,
             except ProjectVariable.DoesNotExist:
                 pass
@@ -2188,6 +2194,10 @@ if True:
                 return_data['package_classes'] = ProjectVariable.objects.get(project = prj, name = "PACKAGE_CLASSES").value,
             except ProjectVariable.DoesNotExist:
                 pass
+            try:
+                return_data['sstate_dir'] = ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value,
+            except ProjectVariable.DoesNotExist:
+                pass
 
             return HttpResponse(json.dumps( return_data ), content_type = "application/json")
 
@@ -2728,9 +2738,9 @@ if True:
         }
 
         vars_blacklist  = {
-            'DL_DR','PARALLEL_MAKE','BB_NUMBER_THREADS','SSTATE_DIR',
+            'PARALLEL_MAKE','BB_NUMBER_THREADS',
             'BB_DISKMON_DIRS','BB_NUMBER_THREADS','CVS_PROXY_HOST','CVS_PROXY_PORT',
-            'DL_DIR','PARALLEL_MAKE','SSTATE_DIR','SSTATE_DIR','SSTATE_MIRRORS','TMPDIR',
+            'PARALLEL_MAKE','SSTATE_MIRRORS','TMPDIR',
             'all_proxy','ftp_proxy','http_proxy ','https_proxy'
             }
 
@@ -2768,6 +2778,19 @@ if True:
         except ProjectVariable.DoesNotExist:
             pass
         try:
+            if ProjectVariable.objects.get(project = prj, name = "DL_DIR").value == "${TOPDIR}/../downloads":
+                be = BuildEnvironment.objects.get(pk = str(1))
+                dl_dir = os.path.join(dirname(be.builddir), "downloads")
+                context['dl_dir'] =  dl_dir
+                pv, created = ProjectVariable.objects.get_or_create(project = prj, name = "DL_DIR")
+                pv.value = dl_dir
+                pv.save()
+            else:
+                context['dl_dir'] = ProjectVariable.objects.get(project = prj, name = "DL_DIR").value
+            context['dl_dir_defined'] = "1"
+        except ProjectVariable.DoesNotExist,BuildEnvironment.DoesNotExist:
+            pass
+        try:
             context['fstypes'] =  ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value
             context['fstypes_defined'] = "1"
         except ProjectVariable.DoesNotExist:
@@ -2782,6 +2805,19 @@ if True:
             context['package_classes_defined'] = "1"
         except ProjectVariable.DoesNotExist:
             pass
+        try:
+            if ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value == "${TOPDIR}/../sstate-cache":
+                be = BuildEnvironment.objects.get(pk = str(1))
+                sstate_dir = os.path.join(dirname(be.builddir), "sstate-cache")
+                context['sstate_dir'] = sstate_dir
+                pv, created = ProjectVariable.objects.get_or_create(project = prj, name = "SSTATE_DIR")
+                pv.value = sstate_dir
+                pv.save()
+            else:
+                context['sstate_dir'] = ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value
+            context['sstate_dir_defined'] = "1"
+        except ProjectVariable.DoesNotExist, BuildEnvironment.DoesNotExist:
+            pass
 
         return context
 
-- 
2.1.4



  parent reply	other threads:[~2016-03-23 10:37 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23  8:14 [PATCH v6 00/41] per project build directory + build cancel + DL_DIR/SSTATE_DIR Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 01/41] toaster: don't start bitbake server Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 02/41] toaster: get rid of noui option Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 03/41] toaster: set BITBAKE_UI environment variable Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 04/41] toasterui: add brbe parameter to buildinfohelper Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 05/41] uievent: improve BBUIEventQueue code Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 06/41] buildinfohelper: improve handling of providermap Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 07/41] toasterui: fix brbe reporting Ed Bartosh
2016-03-23  8:14 ` [PATCH v6 08/41] toaster: remove startBBServer API Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 09/41] toaster: remove release API Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 10/41] toaster: add brbe parameter to triggerBuild Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 11/41] toaster: modified setLayers API Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 12/41] toaster: reimplement triggerBuild Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 13/41] toaster: add new parameter to _shellcmd Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 14/41] toaster: stop bitbake server after the build Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 15/41] toaster: update conf/local.conf Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 16/41] toaster: fix jethro build Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 17/41] toaster: use bash explicitly Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 18/41] toasterui: shutdown on BuildCompleted event Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 19/41] toaster: bldcontrol Add forceShutDown function to BitbakeController Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 20/41] toaster: Move xhr calls for starting and stopping builds Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 21/41] toaster: xhr Update the implementation of the build cancellation request Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 22/41] toaster: libtoaster Update implementation of startABuild and cancelABuild Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 23/41] toaster: update BuildEnvironmentController and BitbakeController Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 24/41] toaster: models Add cancelled state to build outcome Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 25/41] toaster: bldcontrol models Add a cancelling state the BuildRequest Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 26/41] buildinfohelper: Add handler for cancelling a build Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 27/41] toaster: tables BuildsTable exclude cancelled builds Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 28/41] toaster: mrb_section template Add build cancel button Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 29/41] toaster: models Exclude the CANCELLED builds from get_number_of_builds Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 30/41] toaster: runbuilds Make runbuilds aware of the build CANCELLED state Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 31/41] toaster: runbuilds Clean up runbuilds Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 32/41] toaster: fix conflicting migrations Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 33/41] toaster: use empty token Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 34/41] toaster: add DL_DIR and SSTATE_DIR to poky toasterconf Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 35/41] toaster: add DL_DIR and SSTATE_DIR to oe toasterconf Ed Bartosh
2016-03-23  8:15 ` Ed Bartosh [this message]
2016-03-23  8:15 ` [PATCH v6 37/41] toaster: update projectconf.html for DL_DIR and SSTATE_DIR Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 38/41] toaster: use bitbake from sourcedir/bitbake/bin Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 39/41] toasterui: detect build run start correctly on Jethro Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 40/41] buildinfohelper: fix KeyError Ed Bartosh
2016-03-23  8:15 ` [PATCH v6 41/41] toasterui: fix warning 'Unknown event' Ed Bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=977fc336a1e0fcc57e2f01cb7aca751710de5306.1458720709.git.ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.