소스 검색

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]

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>
Paul Eggleton 4 년 전
부모
커밋
5bd29d448a
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      lib/toaster/toastermain/management/commands/buildimport.py

+ 11 - 1
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)