# ${param//pattern/replacement}
# as a shorthand for
# `echo "$param" | sed -e "s/pattern/replacement/g"`.
- # Note: The 'eval' above silences stderr output in dash.
- func_cache_var ()
+ # Note: The 'eval' is necessary for dash and NetBSD /bin/sh.
+ eval 'func_cache_var ()
{
cachevar=c_${1//[!a-zA-Z0-9_]/_}
- }
+ }'
else
func_cache_var ()
{
func_cache_lookup_module ()
{
if $have_associative; then
- cached=${modcache_cached[$1]}
+ eval 'cached=${modcache_cached[$1]}'
else
func_cache_var "$1"
eval "cached=\"\$${cachevar}_cached\""
# Not found in cache. Look it up on the file system.
func_lookup_file "modules/$1"
if $have_associative; then
- modcache_cached[$1]=yes
+ eval 'modcache_cached[$1]=yes'
else
eval "${cachevar}_cached=\"\$1\""
fi
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_description[$1]+set}"; then
- echo "${modcache_description[$1]}"
+ if eval 'test -n "${modcache_description[$1]+set}"'; then
+ eval 'echo "${modcache_description[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_description_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_comment[$1]+set}"; then
- echo "${modcache_comment[$1]}"
+ if eval 'test -n "${modcache_comment[$1]+set}"'; then
+ eval 'echo "${modcache_comment[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_comment_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_status[$1]+set}"; then
- echo "${modcache_status[$1]}"
+ if eval 'test -n "${modcache_status[$1]+set}"'; then
+ eval 'echo "${modcache_status[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_status_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_notice[$1]+set}"; then
- echo "${modcache_notice[$1]}"
+ if eval 'test -n "${modcache_notice[$1]+set}"'; then
+ eval 'echo "${modcache_notice[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_notice_set\""
func_cache_lookup_module "$1"
# Get the field's value, without the final newline.
if $have_associative; then
- my_applicability="${modcache_applicability[$1]}"
+ eval 'my_applicability="${modcache_applicability[$1]}"'
else
eval "my_applicability=\"\$${cachevar}_applicability\""
fi
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_files[$1]+set}"; then
- echo "${modcache_files[$1]}"
+ if eval 'test -n "${modcache_files[$1]+set}"'; then
+ eval 'echo "${modcache_files[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_files_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_dependson[$1]+set}"; then
- echo "${modcache_dependson[$1]}"
+ if eval 'test -n "${modcache_dependson[$1]+set}"'; then
+ eval 'echo "${modcache_dependson[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_dependson_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_configureac_early[$1]+set}"; then
- echo "${modcache_configureac_early[$1]}"
+ if eval 'test -n "${modcache_configureac_early[$1]+set}"'; then
+ eval 'echo "${modcache_configureac_early[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_configureac_early_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_configureac[$1]+set}"; then
- echo "${modcache_configureac[$1]}"
+ if eval 'test -n "${modcache_configureac[$1]+set}"'; then
+ eval 'echo "${modcache_configureac[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_configureac_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_makefile[$1]+set}"; then
- echo "${modcache_makefile[$1]}"
+ if eval 'test -n "${modcache_makefile[$1]+set}"'; then
+ eval 'echo "${modcache_makefile[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_makefile_set\""
sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file"
else
if $have_associative; then
- if test -n "${modcache_makefile[$1]+set}"; then
- echo "${modcache_makefile[$1]}"
+ if eval 'test -n "${modcache_makefile[$1]+set}"'; then
+ eval 'echo "${modcache_makefile[$1]}"'
fi
else
eval 'field_set="$'"${cachevar}"'_makefile_set"'
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_include[$1]+set}"; then
- echo "${modcache_include[$1]}"
+ if eval 'test -n "${modcache_include[$1]+set}"'; then
+ eval 'echo "${modcache_include[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_include_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_link[$1]+set}"; then
- echo "${modcache_link[$1]}"
+ if eval 'test -n "${modcache_link[$1]+set}"'; then
+ eval 'echo "${modcache_link[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_link_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_license[$1]+set}"; then
- echo "${modcache_license[$1]}"
+ if eval 'test -n "${modcache_license[$1]+set}"'; then
+ eval 'echo "${modcache_license[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_license_set\""
func_cache_lookup_module "$1"
# Output the field's value, including the final newline (if any).
if $have_associative; then
- if test -n "${modcache_maintainer[$1]+set}"; then
- echo "${modcache_maintainer[$1]}"
+ if eval 'test -n "${modcache_maintainer[$1]+set}"'; then
+ eval 'echo "${modcache_maintainer[$1]}"'
fi
else
eval "field_set=\"\$${cachevar}_maintainer_set\""
# Use an associative array, for O(N) worst-case run time.
declare -A to_remove
for m in $1; do
- to_remove[$m]=yes
+ eval 'to_remove[$m]=yes'
done
for module in $cached_specified_modules; do
- if test -z "${to_remove[$module]}"; then
+ if eval 'test -z "${to_remove[$module]}"'; then
func_append specified_modules "$module "
fi
done