diff --git a/configure b/configure index d0ac29ae1..3c865dad9 100755 --- a/configure +++ b/configure @@ -692,13 +692,21 @@ read_registry_file() if [ "${mem}" != "${mems_mem}" ]; then #clist="${config_registry[$config]}" - clist=$(query_array "config_registry" ${config}) + clisttmp=$(query_array "config_registry" ${config}) # Replace the current config with its constituent config set, # canonicalize whitespace, and then remove duplicate config # set names, if they exist. Finally, update the config registry # with the new config list. - newclist=$(echo -e "${clist}" | sed -e "s/${mem}/${mems_mem}/g") + # NOTE: WE must use substitute_words() rather than a simple sed + # expression because we need to avoid matching partial strings. + # For example, if clist above contains "foo bar barsk" and we use + # sed to substitute "bee boo" as the members of "bar", the + # result would (incorrectly) be "foo bee boo bee boosk", + # which would then get reduced, via rm_duplicate_words(), to + # "foo bee boo boosk". + #newclist=$(echo -e "${clist}" | sed -e "s/${mem}/${mems_mem}/g") + newclist=$(substitute_words "${mem}" "${mems_mem}" "${clisttmp}") newclist=$(canonicalize_ws "${newclist}") newclist=$(rm_duplicate_words "${newclist}") @@ -781,6 +789,13 @@ 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. + # NOTE: WE must use substitute_words() rather than a simple sed + # expression because we need to avoid matching partial strings. + # For example, if klist above contains "foo bar barsk" and we use + # sed to substitute "bee boo" as the members of "bar", the + # result would (incorrectly) be "foo bee boo bee boosk", + # which would then get reduced, via rm_duplicate_words(), to + # "foo bee boo boosk". #newklist=$(echo -e "${klisttmp}" | sed -e "s/${ker}/${kers_ker}/g") newklist=$(substitute_words "${ker}" "${kers_ker}" "${klisttmp}") newklist=$(canonicalize_ws "${newklist}")