From ad6231cca3fc1e477752ecd31b1ee2323398a642 Mon Sep 17 00:00:00 2001 From: sunchengguo Date: Tue, 6 Jul 2021 07:30:00 -0400 Subject: [PATCH] Fixed configure script bug. Details: - Fixed kernel list string substitution error by adding function substitute_words in configure script. if the string contains zen and zen2, and zen need to be replaced with another string, then zen2 also be incorrectly replaced. --- configure | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 92a6c229c..a3f98ba9a 100755 --- a/configure +++ b/configure @@ -775,7 +775,8 @@ read_registry_file() # canonicalize whitespace, and then remove duplicate kernel # set names, if they exist. Finally, update the kernel registry # with the new kernel list. - newklist=$(echo -e "${klisttmp}" | sed -e "s/${ker}/${kers_ker}/g") + #newklist=$(echo -e "${klisttmp}" | sed -e "s/${ker}/${kers_ker}/g") + newklist=$(substitute_words "${ker}" "${kers_ker}" "${klisttmp}") newklist=$(canonicalize_ws "${newklist}") newklist=$(rm_duplicate_words "${newklist}") @@ -797,6 +798,26 @@ read_registry_file() done } +substitute_words() +{ + local word new_words list newlist + + word="$1" + new_words="$2" + list="$3" + + for str in ${list}; do + + if [ "${str}" == "${word}" ]; then + newlist="${newlist} ${new_words}" + else + newlist="${newlist} ${str}" + fi + done + + echo "${newlist}" +} + build_kconfig_registry() { local familyname clist config kernels kernel cur_configs newvalue