diff options
| -rw-r--r-- | bitbake/lib/toaster/toastermain/management/commands/buildimport.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py index 7718caa57a..59da6ff7ac 100644 --- a/bitbake/lib/toaster/toastermain/management/commands/buildimport.py +++ b/bitbake/lib/toaster/toastermain/management/commands/buildimport.py | |||
| @@ -114,6 +114,15 @@ class Command(BaseCommand): | |||
| 114 | help='command (configure,reconfigure,import)', | 114 | help='command (configure,reconfigure,import)', |
| 115 | ) | 115 | ) |
| 116 | 116 | ||
| 117 | def get_var(self, varname): | ||
| 118 | value = self.vars.get(varname, '') | ||
| 119 | if value: | ||
| 120 | varrefs = re.findall('\${([^}]*)}', value) | ||
| 121 | for ref in varrefs: | ||
| 122 | if ref in self.vars: | ||
| 123 | value = value.replace('${%s}' % ref, self.vars[ref]) | ||
| 124 | return value | ||
| 125 | |||
| 117 | # Extract the bb variables from a conf file | 126 | # Extract the bb variables from a conf file |
| 118 | def scan_conf(self,fn): | 127 | def scan_conf(self,fn): |
| 119 | vars = self.vars | 128 | vars = self.vars |
| @@ -241,7 +250,7 @@ class Command(BaseCommand): | |||
| 241 | # Apply table of all layer versions | 250 | # Apply table of all layer versions |
| 242 | def extract_bblayers(self): | 251 | def extract_bblayers(self): |
| 243 | # set up the constants | 252 | # set up the constants |
| 244 | bblayer_str = self.vars['BBLAYERS'] | 253 | bblayer_str = self.get_var('BBLAYERS') |
| 245 | TOASTER_DIR = os.environ.get('TOASTER_DIR') | 254 | TOASTER_DIR = os.environ.get('TOASTER_DIR') |
| 246 | INSTALL_CLONE_PREFIX = os.path.dirname(TOASTER_DIR) + "/" | 255 | INSTALL_CLONE_PREFIX = os.path.dirname(TOASTER_DIR) + "/" |
| 247 | TOASTER_CLONE_PREFIX = TOASTER_DIR + "/_toaster_clones/" | 256 | TOASTER_CLONE_PREFIX = TOASTER_DIR + "/_toaster_clones/" |
| @@ -421,6 +430,7 @@ class Command(BaseCommand): | |||
| 421 | 430 | ||
| 422 | # Scan the project's conf files (if any) | 431 | # Scan the project's conf files (if any) |
| 423 | def scan_conf_variables(self,project_path): | 432 | def scan_conf_variables(self,project_path): |
| 433 | self.vars['TOPDIR'] = project_path | ||
| 424 | # scan the project's settings, add any new layers or variables | 434 | # scan the project's settings, add any new layers or variables |
| 425 | if os.path.isfile("%s/conf/local.conf" % project_path): | 435 | if os.path.isfile("%s/conf/local.conf" % project_path): |
| 426 | self.scan_conf("%s/conf/local.conf" % project_path) | 436 | self.scan_conf("%s/conf/local.conf" % project_path) |
