Fixed substitution bug in configure.

Details:
- Fixed a bug in configure related to the building of the so-called
  config list. When processing the contents of config_registry,
  configure creates a series of structures and list that allow for
  various mappings related to configuration families, subconfigs,
  and kernel sets. Two of those lists are built via subsitituion
  of umbrella families with their subconfig members, and one of
  those lists was improperly performing the subtitution in a way
  that would erroneously match on partial umbrella family names.
  That code was changed to match the code that was already doing
  the subtitution properly, via substitute_words().
- Added comments noting the importance of using substitute_words()
  in both instances.
This commit is contained in:
Field G. Van Zee
2021-10-14 13:50:28 -05:00
parent e9da6425e2
commit 514fd10174

19
configure vendored
View File

@@ -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}")