summaryrefslogtreecommitdiffstats
path: root/external/poky/bitbake/lib/toaster/toastermain
diff options
context:
space:
mode:
Diffstat (limited to 'external/poky/bitbake/lib/toaster/toastermain')
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py8
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/management/commands/buildimport.py37
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py7
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py16
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/management/commands/perf.py4
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/settings.py32
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/settings_production_example.py15
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/settings_test.py15
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/urls.py19
-rw-r--r--external/poky/bitbake/lib/toaster/toastermain/wsgi.py7
10 files changed, 50 insertions, 110 deletions
diff --git a/external/poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py b/external/poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
index bf69a8fb..93919dec 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/management/commands/builddelete.py
@@ -1,9 +1,11 @@
-from django.core.management.base import BaseCommand, CommandError
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from django.core.management.base import BaseCommand
from django.core.exceptions import ObjectDoesNotExist
from orm.models import Build
from django.db import OperationalError
-import os
-
class Command(BaseCommand):
diff --git a/external/poky/bitbake/lib/toaster/toastermain/management/commands/buildimport.py b/external/poky/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
index 2d57ab55..59da6ff7 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/management/commands/buildimport.py
@@ -1,23 +1,10 @@
#
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
# BitBake Toaster Implementation
#
# Copyright (C) 2018 Wind River Systems
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# SPDX-License-Identifier: GPL-2.0-only
#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# buildimport: import a project for project specific configuration
#
@@ -44,12 +31,10 @@
# ../bitbake/lib/toaster/manage.py buildimport --name=test --path=`pwd` --callback="" --command=import
-from django.core.management.base import BaseCommand, CommandError
-from django.core.exceptions import ObjectDoesNotExist
-from orm.models import ProjectManager, Project, Release, ProjectVariable
+from django.core.management.base import BaseCommand
+from orm.models import Project, Release, ProjectVariable
from orm.models import Layer, Layer_Version, LayerSource, ProjectLayer
from toastergui.api import scan_layer_content
-from django.db import OperationalError
import os
import re
@@ -129,6 +114,15 @@ class Command(BaseCommand):
help='command (configure,reconfigure,import)',
)
+ def get_var(self, varname):
+ value = self.vars.get(varname, '')
+ if value:
+ varrefs = re.findall('\${([^}]*)}', value)
+ for ref in varrefs:
+ if ref in self.vars:
+ value = value.replace('${%s}' % ref, self.vars[ref])
+ return value
+
# Extract the bb variables from a conf file
def scan_conf(self,fn):
vars = self.vars
@@ -256,7 +250,7 @@ class Command(BaseCommand):
# Apply table of all layer versions
def extract_bblayers(self):
# set up the constants
- bblayer_str = self.vars['BBLAYERS']
+ bblayer_str = self.get_var('BBLAYERS')
TOASTER_DIR = os.environ.get('TOASTER_DIR')
INSTALL_CLONE_PREFIX = os.path.dirname(TOASTER_DIR) + "/"
TOASTER_CLONE_PREFIX = TOASTER_DIR + "/_toaster_clones/"
@@ -436,6 +430,7 @@ class Command(BaseCommand):
# Scan the project's conf files (if any)
def scan_conf_variables(self,project_path):
+ self.vars['TOPDIR'] = project_path
# scan the project's settings, add any new layers or variables
if os.path.isfile("%s/conf/local.conf" % project_path):
self.scan_conf("%s/conf/local.conf" % project_path)
@@ -481,7 +476,6 @@ class Command(BaseCommand):
release_name = 'None' if not pl.layercommit.release else pl.layercommit.release.name
print(" AFTER :ProjectLayer=%s,%s,%s,%s" % (pl.layercommit.layer.name,release_name,pl.layercommit.branch,pl.layercommit.commit))
-
def handle(self, *args, **options):
project_name = options['name']
project_path = options['path']
@@ -520,7 +514,7 @@ class Command(BaseCommand):
default_release = Release.objects.get(id=1)
# SANITY: if 'reconfig' but project does not exist (deleted externally), switch to 'import'
- if ("reconfigure" == options['command']) and (None == project):
+ if ("reconfigure" == options['command']) and project is None:
options['command'] = 'import'
# 'Configure':
@@ -566,6 +560,7 @@ class Command(BaseCommand):
# preset the mode and default image recipe
project.set_variable(Project.PROJECT_SPECIFIC_ISNEW,Project.PROJECT_SPECIFIC_NEW)
project.set_variable(Project.PROJECT_SPECIFIC_DEFAULTIMAGE,"core-image-minimal")
+
# Assert any extended/custom actions or variables for new non-Toaster projects
if not len(self.toaster_vars):
pass
diff --git a/external/poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py b/external/poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
index 70b5812d..3ad5289c 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/management/commands/buildslist.py
@@ -1,6 +1,9 @@
-from django.core.management.base import BaseCommand, CommandError
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+from django.core.management.base import BaseCommand
from orm.models import Build
-import os
diff --git a/external/poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py b/external/poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py
index 0399b865..811fd5d5 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/management/commands/checksocket.py
@@ -1,23 +1,11 @@
-#!/usr/bin/env python
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#!/usr/bin/env python3
#
# BitBake Toaster Implementation
#
# Copyright (C) 2015 Intel Corporation
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
+# SPDX-License-Identifier: GPL-2.0-only
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""Custom management command checksocket."""
diff --git a/external/poky/bitbake/lib/toaster/toastermain/management/commands/perf.py b/external/poky/bitbake/lib/toaster/toastermain/management/commands/perf.py
index 6b450bbd..7d629fb3 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/management/commands/perf.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/management/commands/perf.py
@@ -1,3 +1,7 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
from django.core.management.base import BaseCommand
from django.test.client import Client
import os, sys, re
diff --git a/external/poky/bitbake/lib/toaster/toastermain/settings.py b/external/poky/bitbake/lib/toaster/toastermain/settings.py
index 13541d38..a4b370c8 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/settings.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/settings.py
@@ -1,23 +1,10 @@
#
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# SPDX-License-Identifier: GPL-2.0-only
#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Django settings for Toaster project.
@@ -202,15 +189,16 @@ TEMPLATES = [
},
]
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE = [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
- # Uncomment the next line for simple clickjacking protection:
- # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
-)
+ 'django.contrib.auth.middleware.AuthenticationMiddleware',
+ 'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.contrib.sessions.middleware.SessionMiddleware',
+]
CACHES = {
# 'default': {
@@ -261,7 +249,7 @@ FRESH_ENABLED = False
if os.environ.get('TOASTER_DEVEL', None) is not None:
try:
import fresh
- MIDDLEWARE_CLASSES = ("fresh.middleware.FreshMiddleware",) + MIDDLEWARE_CLASSES
+ MIDDLEWARE = ["fresh.middleware.FreshMiddleware",] + MIDDLEWARE
INSTALLED_APPS = INSTALLED_APPS + ('fresh',)
FRESH_ENABLED = True
except:
@@ -271,8 +259,8 @@ DEBUG_PANEL_ENABLED = False
if os.environ.get('TOASTER_DEVEL', None) is not None:
try:
import debug_toolbar, debug_panel
- MIDDLEWARE_CLASSES = ('debug_panel.middleware.DebugPanelMiddleware',) + MIDDLEWARE_CLASSES
- #MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + ('debug_toolbar.middleware.DebugToolbarMiddleware',)
+ MIDDLEWARE = ['debug_panel.middleware.DebugPanelMiddleware',] + MIDDLEWARE
+ #MIDDLEWARE = MIDDLEWARE + ['debug_toolbar.middleware.DebugToolbarMiddleware',]
INSTALLED_APPS = INSTALLED_APPS + ('debug_toolbar','debug_panel',)
DEBUG_PANEL_ENABLED = True
@@ -365,5 +353,3 @@ def activate_synchronous_off(sender, connection, **kwargs):
connection_created.connect(activate_synchronous_off)
#
-
-
diff --git a/external/poky/bitbake/lib/toaster/toastermain/settings_production_example.py b/external/poky/bitbake/lib/toaster/toastermain/settings_production_example.py
index 61a28886..6cd0f52d 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/settings_production_example.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/settings_production_example.py
@@ -1,23 +1,10 @@
#
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
# BitBake Toaster Implementation
#
# Copyright (C) 2016 Intel Corporation
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# SPDX-License-Identifier: GPL-2.0-only
#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# See Django documentation for more information about deployment
# https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
diff --git a/external/poky/bitbake/lib/toaster/toastermain/settings_test.py b/external/poky/bitbake/lib/toaster/toastermain/settings_test.py
index a3227115..6538d9e4 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/settings_test.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/settings_test.py
@@ -1,23 +1,10 @@
#
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
# BitBake Toaster Implementation
#
# Copyright (C) 2016 Intel Corporation
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# SPDX-License-Identifier: GPL-2.0-only
#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Django settings for Toaster project.
diff --git a/external/poky/bitbake/lib/toaster/toastermain/urls.py b/external/poky/bitbake/lib/toaster/toastermain/urls.py
index e2fb0aeb..5fb520b3 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/urls.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/urls.py
@@ -1,23 +1,10 @@
#
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-#
# BitBake Toaster Implementation
#
# Copyright (C) 2013 Intel Corporation
#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# SPDX-License-Identifier: GPL-2.0-only
#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from django.conf.urls import include, url
from django.views.generic import RedirectView, TemplateView
@@ -64,7 +51,7 @@ if toastermain.settings.DEBUG_PANEL_ENABLED:
urlpatterns = [
# Uncomment the next line to enable the admin:
- url(r'^admin/', include(admin.site.urls)),
+ url(r'^admin/', admin.site.urls),
] + urlpatterns
# Automatically discover urls.py in various apps, beside our own
@@ -82,7 +69,7 @@ for t in os.walk(os.path.dirname(currentdir)):
# make sure we don't have this module name in
conflict = False
for p in urlpatterns:
- if p.regex.pattern == '^' + modulename + '/':
+ if p.pattern.regex.pattern == '^' + modulename + '/':
conflict = True
if not conflict:
urlpatterns.insert(0, url(r'^' + modulename + '/', include ( modulename + '.urls')))
diff --git a/external/poky/bitbake/lib/toaster/toastermain/wsgi.py b/external/poky/bitbake/lib/toaster/toastermain/wsgi.py
index 031b314b..4c312832 100644
--- a/external/poky/bitbake/lib/toaster/toastermain/wsgi.py
+++ b/external/poky/bitbake/lib/toaster/toastermain/wsgi.py
@@ -1,7 +1,8 @@
-"""
-# ex:ts=4:sw=4:sts=4:et
-# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+
+"""
WSGI config for Toaster project.
This module contains the WSGI application used by Django's development server