summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2020-03-27 15:51:02 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-29 20:02:36 +0100
commitabee806f114fff3565d8796db0eab86f64bb937b (patch)
tree589606c761311217d3a35df53ebd0a5e4ae29104 /bitbake
parent4f959dff769f37d745daf705dd169704656e0ba3 (diff)
downloadpoky-abee806f114fff3565d8796db0eab86f64bb937b.tar.gz
bitbake: toaster: fix for import build directory with var refs in BBLAYERS
Update importing a build directory to support where bblayers.conf sets BBLAYERS to a value that includes a variable reference e.g.: BBLAYERS = "${TOPDIR}/../meta \ ${TOPDIR}/../meta-selftest" [YOCTO #13707] (Bitbake rev: 5bd29d448a31c132afd6fc0127029e246759b87b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: David Reyna <David.Reyna@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/buildimport.py12
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)