From 43b29a0547ef2d0469660fc1c37c9133f467b7ca Mon Sep 17 00:00:00 2001 From: Valentyn Korniienko <25596072+ValentiWorkLearning@users.noreply.github.com> Date: Thu, 1 May 2025 17:21:36 +0300 Subject: [PATCH] Fixed empty line handling process_config.sh This commit fixed empty line handling in the config file for being able to used KConfig-based defconfigs with the empty lines in them --- tools/process_config.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/process_config.sh b/tools/process_config.sh index 067e65f1046..8befc557c16 100755 --- a/tools/process_config.sh +++ b/tools/process_config.sh @@ -56,9 +56,15 @@ process_file() { exit 1 fi else - local key_config="$(echo "$line" | cut -d= -f1)=" - sed -i.backup "/$key_config/d" $output_file - echo "$line" >> $output_file + if [[ -n "$line" ]]; then + local key_config="$(echo "$line" | cut -d= -f1)=" + sed -i.backup "/^$key_config/d" "$output_file" + echo "$line" >> "$output_file" + + echo "Appended $line to $output_file" + else + echo "The empty line from defconfig was skipped from adding to $output_file" + fi fi done < "$input_file" }