summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorSujith H <sujith.h@gmail.com>2016-04-06 17:46:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-06 23:10:30 +0100
commit705d44fc0d82bbe9723a9eafc7c440d974be0857 (patch)
tree602c127d693833afeb699eeac046fb69cefd271a /bitbake
parent4aafcae5e4dbf74767c185ca79f1c5969b7b1516 (diff)
downloadpoky-705d44fc0d82bbe9723a9eafc7c440d974be0857.tar.gz
bitbake: toaster: update view to support DL_DIR and SSTATE_DIR
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] (Bitbake rev: 9f672d7ba503d17175eef37ec03a5779e4c9f792) Signed-off-by: Sujith H <sujith.h@gmail.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py40
1 files changed, 38 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index cc7ad17cf1..8b685abe83 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -45,6 +45,7 @@ from django.utils import formats
45from toastergui.templatetags.projecttags import json as jsonfilter 45from toastergui.templatetags.projecttags import json as jsonfilter
46from decimal import Decimal 46from decimal import Decimal
47import json 47import json
48import os
48from os.path import dirname 49from os.path import dirname
49from functools import wraps 50from functools import wraps
50import itertools 51import itertools
@@ -1875,6 +1876,7 @@ def managedcontextprocessor(request):
1875import toastermain.settings 1876import toastermain.settings
1876 1877
1877from orm.models import Project, ProjectLayer, ProjectTarget, ProjectVariable 1878from orm.models import Project, ProjectLayer, ProjectTarget, ProjectVariable
1879from bldcontrol.models import BuildEnvironment
1878 1880
1879# we have a set of functions if we're in managed mode, or 1881# we have a set of functions if we're in managed mode, or
1880# a default "page not available" simple functions for interactive mode 1882# a default "page not available" simple functions for interactive mode
@@ -2177,6 +2179,10 @@ if True:
2177 except ProjectVariable.DoesNotExist: 2179 except ProjectVariable.DoesNotExist:
2178 pass 2180 pass
2179 try: 2181 try:
2182 return_data['dl_dir'] = ProjectVariable.objects.get(project = prj, name = "DL_DIR").value,
2183 except ProjectVariable.DoesNotExist:
2184 pass
2185 try:
2180 return_data['fstypes'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value, 2186 return_data['fstypes'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value,
2181 except ProjectVariable.DoesNotExist: 2187 except ProjectVariable.DoesNotExist:
2182 pass 2188 pass
@@ -2188,6 +2194,10 @@ if True:
2188 return_data['package_classes'] = ProjectVariable.objects.get(project = prj, name = "PACKAGE_CLASSES").value, 2194 return_data['package_classes'] = ProjectVariable.objects.get(project = prj, name = "PACKAGE_CLASSES").value,
2189 except ProjectVariable.DoesNotExist: 2195 except ProjectVariable.DoesNotExist:
2190 pass 2196 pass
2197 try:
2198 return_data['sstate_dir'] = ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value,
2199 except ProjectVariable.DoesNotExist:
2200 pass
2191 2201
2192 return HttpResponse(json.dumps( return_data ), content_type = "application/json") 2202 return HttpResponse(json.dumps( return_data ), content_type = "application/json")
2193 2203
@@ -2795,9 +2805,9 @@ if True:
2795 } 2805 }
2796 2806
2797 vars_blacklist = { 2807 vars_blacklist = {
2798 'DL_DR','PARALLEL_MAKE','BB_NUMBER_THREADS','SSTATE_DIR', 2808 'PARALLEL_MAKE','BB_NUMBER_THREADS',
2799 'BB_DISKMON_DIRS','BB_NUMBER_THREADS','CVS_PROXY_HOST','CVS_PROXY_PORT', 2809 'BB_DISKMON_DIRS','BB_NUMBER_THREADS','CVS_PROXY_HOST','CVS_PROXY_PORT',
2800 'DL_DIR','PARALLEL_MAKE','SSTATE_DIR','SSTATE_DIR','SSTATE_MIRRORS','TMPDIR', 2810 'PARALLEL_MAKE','SSTATE_MIRRORS','TMPDIR',
2801 'all_proxy','ftp_proxy','http_proxy ','https_proxy' 2811 'all_proxy','ftp_proxy','http_proxy ','https_proxy'
2802 } 2812 }
2803 2813
@@ -2835,6 +2845,19 @@ if True:
2835 except ProjectVariable.DoesNotExist: 2845 except ProjectVariable.DoesNotExist:
2836 pass 2846 pass
2837 try: 2847 try:
2848 if ProjectVariable.objects.get(project = prj, name = "DL_DIR").value == "${TOPDIR}/../downloads":
2849 be = BuildEnvironment.objects.get(pk = str(1))
2850 dl_dir = os.path.join(dirname(be.builddir), "downloads")
2851 context['dl_dir'] = dl_dir
2852 pv, created = ProjectVariable.objects.get_or_create(project = prj, name = "DL_DIR")
2853 pv.value = dl_dir
2854 pv.save()
2855 else:
2856 context['dl_dir'] = ProjectVariable.objects.get(project = prj, name = "DL_DIR").value
2857 context['dl_dir_defined'] = "1"
2858 except ProjectVariable.DoesNotExist,BuildEnvironment.DoesNotExist:
2859 pass
2860 try:
2838 context['fstypes'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value 2861 context['fstypes'] = ProjectVariable.objects.get(project = prj, name = "IMAGE_FSTYPES").value
2839 context['fstypes_defined'] = "1" 2862 context['fstypes_defined'] = "1"
2840 except ProjectVariable.DoesNotExist: 2863 except ProjectVariable.DoesNotExist:
@@ -2849,6 +2872,19 @@ if True:
2849 context['package_classes_defined'] = "1" 2872 context['package_classes_defined'] = "1"
2850 except ProjectVariable.DoesNotExist: 2873 except ProjectVariable.DoesNotExist:
2851 pass 2874 pass
2875 try:
2876 if ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value == "${TOPDIR}/../sstate-cache":
2877 be = BuildEnvironment.objects.get(pk = str(1))
2878 sstate_dir = os.path.join(dirname(be.builddir), "sstate-cache")
2879 context['sstate_dir'] = sstate_dir
2880 pv, created = ProjectVariable.objects.get_or_create(project = prj, name = "SSTATE_DIR")
2881 pv.value = sstate_dir
2882 pv.save()
2883 else:
2884 context['sstate_dir'] = ProjectVariable.objects.get(project = prj, name = "SSTATE_DIR").value
2885 context['sstate_dir_defined'] = "1"
2886 except ProjectVariable.DoesNotExist, BuildEnvironment.DoesNotExist:
2887 pass
2852 2888
2853 return context 2889 return context
2854 2890