From 911f386e4efc3338644a0697d6249281d8619692 Mon Sep 17 00:00:00 2001 From: lixinyu Date: Wed, 7 Aug 2024 15:29:06 +0800 Subject: [PATCH] local_conf: fix the parser bug * the local file specifies that each line cannot start with a space. Therefore, after each modification to the local file, the spaces at the beginning of lines that start with spaces are removed. Signed-off-by: lixinyu --- src/oebuild/local_conf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/oebuild/local_conf.py b/src/oebuild/local_conf.py index a17c0dd..4eed6a2 100644 --- a/src/oebuild/local_conf.py +++ b/src/oebuild/local_conf.py @@ -107,6 +107,12 @@ class LocalConf: with open(local_conf_path, 'r', encoding='utf-8') as r_f: self.content = r_f.read() + def __del__(self): + # The local file specifies that each line cannot start with a space. + # Therefore, after each modification to the local file, the spaces at + # the beginning of lines that start with spaces are removed. + os.system(rf"sed -i 's/^ \+//' {self.local_path}") + def update(self, compile_param: CompileParam, src_dir=None): ''' update local.conf by ParseCompile -- Gitee