From f6c36a4ed5acab41ff2e52f2a0eed6386760f079 Mon Sep 17 00:00:00 2001 From: alichinese Date: Tue, 23 May 2023 15:50:03 +0800 Subject: [PATCH 1/4] local: modify the local file handling method * the handling of local.conf files in oebuild should be handled by bitbake, and oebuild will no longer handle local.conf Signed-off-by: lixinyu --- src/oebuild/local_conf.py | 5 ++++- src/oebuild/version.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/oebuild/local_conf.py b/src/oebuild/local_conf.py index 83828b9..6ae658b 100644 --- a/src/oebuild/local_conf.py +++ b/src/oebuild/local_conf.py @@ -168,7 +168,10 @@ class LocalConf: content = self.match_lib_param(content=content) - content = self.replace_param(parse_compile=parse_compile, content=content) + user_content_flag = "#===========the content is user added==================" + if user_content_flag not in content: + content += f"\n{user_content_flag}\n" + content += parse_compile.local_conf if content is None: return diff --git a/src/oebuild/version.py b/src/oebuild/version.py index 81392fe..7409860 100644 --- a/src/oebuild/version.py +++ b/src/oebuild/version.py @@ -10,4 +10,4 @@ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details. ''' -__version__ = '0.0.18' +__version__ = '0.0.20' -- Gitee From 024d0059c7d93346face72c0cba6e10562eb83b6 Mon Sep 17 00:00:00 2001 From: alichinese Date: Wed, 24 May 2023 09:41:10 +0800 Subject: [PATCH 2/4] local: fixed a bug in handling local_conf * if local_conf is not set in the build configuration file, it does not appear in the build file Signed-off-by: lixinyu --- src/oebuild/local_conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oebuild/local_conf.py b/src/oebuild/local_conf.py index 6ae658b..32c205d 100644 --- a/src/oebuild/local_conf.py +++ b/src/oebuild/local_conf.py @@ -169,7 +169,7 @@ class LocalConf: content = self.match_lib_param(content=content) user_content_flag = "#===========the content is user added==================" - if user_content_flag not in content: + if user_content_flag not in content and parse_compile.local_conf is not None: content += f"\n{user_content_flag}\n" content += parse_compile.local_conf -- Gitee From b567feab49785adff12e20512992e61cbbeec984 Mon Sep 17 00:00:00 2001 From: alichinese Date: Wed, 24 May 2023 10:03:35 +0800 Subject: [PATCH 3/4] template: fixed the parsing bug when local_conf is not set * In the build configuration file, if the local_conf variable is not set, it will be processed as a None string and written to local.conf, so that an error will be reported when parsing local.conf Signed-off-by: lixinyu --- src/oebuild/local_conf.py | 2 +- src/oebuild/parse_template.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/oebuild/local_conf.py b/src/oebuild/local_conf.py index 32c205d..ca72555 100644 --- a/src/oebuild/local_conf.py +++ b/src/oebuild/local_conf.py @@ -169,7 +169,7 @@ class LocalConf: content = self.match_lib_param(content=content) user_content_flag = "#===========the content is user added==================" - if user_content_flag not in content and parse_compile.local_conf is not None: + if user_content_flag not in content and parse_compile.local_conf != "": content += f"\n{user_content_flag}\n" content += parse_compile.local_conf diff --git a/src/oebuild/parse_template.py b/src/oebuild/parse_template.py index 4a5464f..921f984 100644 --- a/src/oebuild/parse_template.py +++ b/src/oebuild/parse_template.py @@ -137,8 +137,8 @@ class ParseTemplate: machine=data['machine'], toolchain_type=data['toolchain_type'], repos=repo_dict, - local_conf=local_conf, - layers=layers) + local_conf=None if local_conf is None else LiteralScalarString(local_conf), + layers=None if layers is None else layers) return if self.platform_template is None: @@ -156,8 +156,8 @@ class ParseTemplate: feature_name=LiteralScalarString(os.path.splitext(config_name)[0]), repos=repo_dict, support=support_arch, - local_conf=LiteralScalarString(local_conf), - layers=layers + local_conf=None if local_conf is None else LiteralScalarString(local_conf), + layers=None if layers is None else layers )) except Exception as e_p: @@ -255,6 +255,7 @@ class ParseTemplate: compile_conf['repos'] = repos compile_conf['local_conf'] = local_conf compile_conf['layers'] = layers + return compile_conf @staticmethod -- Gitee From 321de556b274cde2e614828df75fa02ad59e9a1a Mon Sep 17 00:00:00 2001 From: alichinese Date: Wed, 24 May 2023 10:07:26 +0800 Subject: [PATCH 4/4] version: upgrade to 0.0.21 * upgrade version to 0.0.21 Signed-off-by: lixinyu --- src/oebuild/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oebuild/version.py b/src/oebuild/version.py index 7409860..05f2c9a 100644 --- a/src/oebuild/version.py +++ b/src/oebuild/version.py @@ -10,4 +10,4 @@ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details. ''' -__version__ = '0.0.20' +__version__ = '0.0.21' -- Gitee