summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorDavid Reyna <David.Reyna@windriver.com>2014-04-08 16:25:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-09 17:00:01 +0100
commit74e2f8501997143162855b970ffd9fdb33d24bd8 (patch)
treecc764fc756ef3fb7eb50f64ededa06dc252910b1 /bitbake
parentf88a3437734f4f6559d391415089bf571152f63d (diff)
downloadpoky-74e2f8501997143162855b970ffd9fdb33d24bd8.tar.gz
bitbake: toaster: regex alternation filter caused django error
The combination of a regex filter specification that uses alternate, plus a search string, plus multiple search_allowed_fields, leads to a Django fatal error. Replace this regex filter for variables in local files with a simpler 'contains' against the project's directory plus a '/conf/' string. Alex rebased this on top of fix for #6048. [YOCTO #5962] (Bitbake rev: fd57128dc3a35ca87031f3df1a531a085e89baf0) Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py6
-rw-r--r--bitbake/lib/toaster/toastergui/views.py10
2 files changed, 8 insertions, 8 deletions
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index aa1ebf8017..e8634574c0 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -163,7 +163,7 @@ def filter_setin_files(file_list,matchstr):
163 # match only filters 163 # match only filters
164 if search == '': 164 if search == '':
165 for i in range(len(file_list)): 165 for i in range(len(file_list)):
166 if file_list[i].file_name.find(filter) >= 0: 166 if re.search(filter, file_list[i].file_name):
167 if htmlstr.find(file_list[i].file_name + "<p>") < 0: 167 if htmlstr.find(file_list[i].file_name + "<p>") < 0:
168 htmlstr += file_list[i].file_name + "<p>" 168 htmlstr += file_list[i].file_name + "<p>"
169 return htmlstr 169 return htmlstr
@@ -171,7 +171,7 @@ def filter_setin_files(file_list,matchstr):
171 # match only search string, plus always last file 171 # match only search string, plus always last file
172 if filter == "": 172 if filter == "":
173 for i in range(len(file_list)-1): 173 for i in range(len(file_list)-1):
174 if file_list[i].file_name.find(search) >= 0: 174 if re.search(search,file_list[i].file_name):
175 if htmlstr.find(file_list[i].file_name + "<p>") < 0: 175 if htmlstr.find(file_list[i].file_name + "<p>") < 0:
176 htmlstr += file_list[i].file_name + "<p>" 176 htmlstr += file_list[i].file_name + "<p>"
177 if htmlstr.find(file_list[len(file_list)-1].file_name) < 0: 177 if htmlstr.find(file_list[len(file_list)-1].file_name) < 0:
@@ -180,7 +180,7 @@ def filter_setin_files(file_list,matchstr):
180 180
181 # match filter or search string 181 # match filter or search string
182 for i in range(len(file_list)): 182 for i in range(len(file_list)):
183 if (file_list[i].file_name.find(filter) >= 0) or (file_list[i].file_name.find(search) >= 0): 183 if re.search(filter, file_list[i].file_name) or re.search(search,file_list[i].file_name):
184 if htmlstr.find(file_list[i].file_name + "<p>") < 0: 184 if htmlstr.find(file_list[i].file_name + "<p>") < 0:
185 htmlstr += file_list[i].file_name + "<p>" 185 htmlstr += file_list[i].file_name + "<p>"
186 return htmlstr 186 return htmlstr
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 4ed99400c8..78726a88bc 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -1154,17 +1154,17 @@ def configvars(request, build_id):
1154 1154
1155 variables = _build_page_range(Paginator(queryset, request.GET.get('count', 50)), request.GET.get('page', 1)) 1155 variables = _build_page_range(Paginator(queryset, request.GET.get('count', 50)), request.GET.get('page', 1))
1156 1156
1157 # show all matching files (not just the last one)
1157 file_filter= search_term + ":" 1158 file_filter= search_term + ":"
1158 if filter_string.find('conf/local.conf') > 0: 1159 if filter_string.find('/conf/') > 0:
1159 file_filter += 'conf/local.conf' 1160 file_filter += 'conf/(local|bblayers).conf'
1160 if filter_string.find('conf/bblayers.conf') > 0:
1161 file_filter += 'conf/bblayers.conf'
1162 if filter_string.find('conf/machine/') > 0: 1161 if filter_string.find('conf/machine/') > 0:
1163 file_filter += 'conf/machine/' 1162 file_filter += 'conf/machine/'
1164 if filter_string.find('conf/distro/') > 0: 1163 if filter_string.find('conf/distro/') > 0:
1165 file_filter += 'conf/distro/' 1164 file_filter += 'conf/distro/'
1166 if filter_string.find('/bitbake.conf') > 0: 1165 if filter_string.find('/bitbake.conf') > 0:
1167 file_filter += '/bitbake.conf' 1166 file_filter += '/bitbake.conf'
1167 build_dir=re.sub("/tmp/log/.*","",Build.objects.filter(pk=build_id)[0].cooker_log_path)
1168 1168
1169 context = { 1169 context = {
1170 'objectname': 'configvars', 1170 'objectname': 'configvars',
@@ -1193,7 +1193,7 @@ def configvars(request, build_id):
1193 'class' : 'vhistory__file_name', 1193 'class' : 'vhistory__file_name',
1194 'label': 'Show:', 1194 'label': 'Show:',
1195 'options' : [ 1195 'options' : [
1196 ('Local configuration variables', 'vhistory__file_name__regex:conf/(local|bblayers).conf', queryset_with_search.filter(vhistory__file_name__regex='conf/(local|bblayers).conf').count(), 'Select this filter to see variables set by the <code>local.conf</code> and <code>bblayers.conf</code> configuration files inside the <code>/build/conf/</code> directory'), 1196 ('Local configuration variables', 'vhistory__file_name__contains:'+build_dir+'/conf/',queryset_with_search.filter(vhistory__file_name__contains=build_dir+'/conf/').count(), 'Select this filter to see variables set by the <code>local.conf</code> and <code>bblayers.conf</code> configuration files inside the <code>/build/conf/</code> directory'),
1197 ('Machine configuration variables', 'vhistory__file_name__contains:conf/machine/',queryset_with_search.filter(vhistory__file_name__contains='conf/machine').count(), 'Select this filter to see variables set by the configuration file(s) inside your layers <code>/conf/machine/</code> directory'), 1197 ('Machine configuration variables', 'vhistory__file_name__contains:conf/machine/',queryset_with_search.filter(vhistory__file_name__contains='conf/machine').count(), 'Select this filter to see variables set by the configuration file(s) inside your layers <code>/conf/machine/</code> directory'),
1198 ('Distro configuration variables', 'vhistory__file_name__contains:conf/distro/',queryset_with_search.filter(vhistory__file_name__contains='conf/distro').count(), 'Select this filter to see variables set by the configuration file(s) inside your layers <code>/conf/distro/</code> directory'), 1198 ('Distro configuration variables', 'vhistory__file_name__contains:conf/distro/',queryset_with_search.filter(vhistory__file_name__contains='conf/distro').count(), 'Select this filter to see variables set by the configuration file(s) inside your layers <code>/conf/distro/</code> directory'),
1199 ('Layer configuration variables', 'vhistory__file_name__contains:conf/layer.conf',queryset_with_search.filter(vhistory__file_name__contains='conf/layer.conf').count(), 'Select this filter to see variables set by the <code>layer.conf</code> configuration file inside your layers'), 1199 ('Layer configuration variables', 'vhistory__file_name__contains:conf/layer.conf',queryset_with_search.filter(vhistory__file_name__contains='conf/layer.conf').count(), 'Select this filter to see variables set by the <code>layer.conf</code> configuration file inside your layers'),