iop: genconfig: avoid false positives when validating configuration

Fix config validation to avoid false positives caused by comments.
This commit is contained in:
Erik Karlsson 2023-01-12 17:38:41 +01:00
parent 93656b57db
commit 0975f022c5
2 changed files with 6 additions and 20 deletions

View file

@ -42,19 +42,13 @@ function genconfig {
}
function verify_config {
IFS=$'\n'
org=$(<.genconfig.config)
unset IFS
local num
local conf_opt
local conf_org
local conf_new
#echo "lines to check $tot_lines"
num=0
for line in $org
while read -r line
do
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
conf_opt=$(echo $line | grep "^[ #]*CONFIG_" | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
if [ -n "${conf_opt}" ]
then
conf_org=$(find_last ${conf_opt} .genconfig.config)
@ -75,8 +69,7 @@ function genconfig {
#echo -e "wanted [$conf_org] got [$conf_new]"
fi
fi
num=$((num+1))
done
done < .genconfig.config
}
# Takes a board name and returns the target name in global var $target

View file

@ -41,19 +41,13 @@ function genconfig_min {
}
function verify_config {
IFS=$'\n'
org=$(<.genconfig.config)
unset IFS
local num
local conf_opt
local conf_org
local conf_new
#echo "lines to check $tot_lines"
num=0
for line in $org
while read -r line
do
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
conf_opt=$(echo $line | grep "^[ #]*CONFIG_" | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
if [ -n "${conf_opt}" ]
then
conf_org=$(find_last ${conf_opt} .genconfig.config)
@ -74,8 +68,7 @@ function genconfig_min {
#echo -e "wanted [$conf_org] got [$conf_new]"
fi
fi
num=$((num+1))
done
done < .genconfig.config
}
# Takes a board name and returns the target name in global var $target