From 4140961b111cc549877774cf9e15244a46d7c162 Mon Sep 17 00:00:00 2001 From: Henning Schild Date: Thu, 21 Dec 2017 17:21:40 +0100 Subject: [PATCH] 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 --- kas/libcmds.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kas/libcmds.py b/kas/libcmds.py index c25385b..07e0e56 100644 --- a/kas/libcmds.py +++ b/kas/libcmds.py @@ -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 ')