summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/toaster/toastermain/management/commands/buildimport.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/toaster/toastermain/management/commands/buildimport.py b/lib/toaster/toastermain/management/commands/buildimport.py
index 7718caa57..59da6ff7a 100644
--- a/lib/toaster/toastermain/management/commands/buildimport.py
+++ b/lib/toaster/toastermain/management/commands/buildimport.py
@@ -114,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
@@ -241,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/"
@@ -421,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)