diff --git a/extensions/gen-sample-extension-docs.sh b/extensions/gen-sample-extension-docs.sh index e19c430a3..10f0e21aa 100644 --- a/extensions/gen-sample-extension-docs.sh +++ b/extensions/gen-sample-extension-docs.sh @@ -49,7 +49,8 @@ MASTER_HEADER [[ $HOOK_POINT_CALLS_COUNT -gt $HOOK_POINT_CALLS_UNIQUE_COUNT ]] && { # Some hook points were called multiple times, determine which. - HOOK_POINTS_WITH_MULTIPLE_CALLS=$(comm -13 <(sort < "${EXTENSION_MANAGER_TMP_DIR}/hook_point_calls.txt" | uniq) <(sort < "${EXTENSION_MANAGER_TMP_DIR}/hook_point_calls.txt") | sort | uniq | xargs echo -n) + # Find duplicates without comm (uutils coreutils compatible) + HOOK_POINTS_WITH_MULTIPLE_CALLS=$(sort < "${EXTENSION_MANAGER_TMP_DIR}/hook_point_calls.txt" | uniq -d | xargs echo -n) cat << MULTIPLE_CALLS_WARNING - *Important:* The following hook points where called multiple times during the documentation generation. This can be indicative of a bug in the build system. Please check the sources for the invocation of the following hooks: \`${HOOK_POINTS_WITH_MULTIPLE_CALLS}\`. diff --git a/lib/functions/general/extensions.sh b/lib/functions/general/extensions.sh index 8661a5369..acfb3dcef 100644 --- a/lib/functions/general/extensions.sh +++ b/lib/functions/general/extensions.sh @@ -510,8 +510,8 @@ function enable_extension() { after_function_list="$(compgen -A function)" # compare before and after, thus getting the functions defined by the extension. - # comm is oldskool. we like it. go "man comm" to understand -13 below - new_function_list="$(comm -13 <(echo "$before_function_list" | sort) <(echo "$after_function_list" | sort))" + # Avoid comm for uutils coreutils compatibility + new_function_list="$(grep -vxFf <(echo "$before_function_list") <(echo "$after_function_list") || true)" # iterate over defined functions, store them in global associative array extension_function_info for newly_defined_function in ${new_function_list}; do diff --git a/lib/functions/logging/capture.sh b/lib/functions/logging/capture.sh index 47ac3f214..0d8004350 100644 --- a/lib/functions/logging/capture.sh +++ b/lib/functions/logging/capture.sh @@ -18,7 +18,8 @@ function do_capturing_defs() { post_exec_vars="$(compgen -A variable)" - new_vars_list="$(comm -13 <(echo "$pre_exec_vars" | grep -E '[[:upper:]]+' | grep -v -e "^BASH_" | sort) <(echo "${post_exec_vars}" | grep -E '[[:upper:]]+' | grep -v -e "^BASH_" | sort))" + # Avoid comm for uutils coreutils compatibility + new_vars_list="$(grep -vxFf <(echo "$pre_exec_vars" | grep -E '[[:upper:]]+' | grep -v -e "^BASH_") <(echo "${post_exec_vars}" | grep -E '[[:upper:]]+' | grep -v -e "^BASH_") || true)" for onevar in ${new_vars_list}; do all_vars_array+=("$(declare -p "${onevar}")")