libcmds: create directory before open in case it is not there

This could happen if you use kas to checkout repos that do not contain
the directory. i.e. repos that are not actually bb layers

Signed-off-by: Henning Schild <henning.schild@siemens.com>
This commit is contained in:
Henning Schild 2017-12-21 17:21:40 +01:00 committed by Daniel Wagner
parent 19e518cd25
commit 4140961b11

View File

@ -169,6 +169,8 @@ class WriteConfig(Command):
def execute(self, config):
def _write_bblayers_conf(config):
filename = config.build_dir + '/conf/bblayers.conf'
if not os.path.isdir(os.path.dirname(filename)):
os.makedirs(os.path.dirname(filename))
with open(filename, 'w') as fds:
fds.write(config.get_bblayers_conf_header())
fds.write('BBLAYERS ?= " \\\n ')