summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Müller-Klieser <S.Mueller-Klieser@phytec.de>2017-12-04 15:55:41 +0100
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2017-12-11 13:33:06 +0100
commit3bb775dbf9b2c444a331bc928e7694d8e956fc82 (patch)
tree041164f1b071931461f20ce0c2c9f0fad201a759
parent0d0ef858a32d45126cf609a1f2ceecd5ae5f2aa7 (diff)
downloadmeta-phytec-3bb775dbf9b2c444a331bc928e7694d8e956fc82.tar.bz2
meta-phytec-3bb775dbf9b2c444a331bc928e7694d8e956fc82.zip
phylib: change bsp machine search path
Instead of parsing only machines from meta-phytec, we parse all machine.conf files in all layers. We do this to be able to use the 'soc' and 'supported_builds' manifest filter in ksp projects. Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rw-r--r--scripts/phylib.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/scripts/phylib.py b/scripts/phylib.py
index f0f0c62..90f79ce 100644
--- a/scripts/phylib.py
+++ b/scripts/phylib.py
@@ -84,13 +84,11 @@ class Sourcecode(object):
# Interface
self.machines = Vividict()
self.bsp_dir = ""
- self.meta_phytec_dir = ""
try:
#v2 Implementation
cwd = self.search_for_bsp_dir()
self.bsp_dir = cwd
- self.meta_phytec_dir = os.path.join(cwd, "sources/meta-phytec")
self.init_machines()
except (IOError, OSError) as e:
print("Could not find necessary file: ", e)
@@ -110,14 +108,13 @@ class Sourcecode(object):
return os.path.join(self.bsp_dir, '.repo')
def init_machines(self):
- d = os.listdir(os.path.join(self.meta_phytec_dir, 'conf/machine'))
- d.sort()
- for j in d:
- if j.endswith('.conf'):
- machname = os.path.splitext(j)[0]
- path = os.path.join(self.meta_phytec_dir, 'conf/machine', j)
- self.machines[machname]['abs_path'] = path
- self.parse_machine_info(machname)
+ for root, dirs, files in os.walk(self.bsp_dir):
+ for name in files:
+ if name.endswith('.conf') and root.endswith('conf/machine'):
+ machname = os.path.splitext(name)[0]
+ path = os.path.join(root, name)
+ self.machines[machname]['abs_path'] = path
+ self.parse_machine_info(machname)
return True
def parse_machine_info(self, machine):