From: Sean Bright Date: Mon, 27 Nov 2023 16:43:15 +0000 (-0500) Subject: make_xml_documentation: Properly handle absolute LOCAL_MOD_SUBDIRS. X-Git-Tag: 21.1.0-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8087a4ef2c2ea786be0f16c803a5a538622368ab;p=thirdparty%2Fasterisk.git make_xml_documentation: Properly handle absolute LOCAL_MOD_SUBDIRS. If LOCAL_MOD_SUBDIRS contains absolute paths, do not prefix them with the path to Asterisk's source tree. Fixes #142 (cherry picked from commit 5f0b568341eda9b614bff69479fb29f78ba3b424) --- diff --git a/build_tools/make_xml_documentation b/build_tools/make_xml_documentation index 3446fff0c8..df3f59dc54 100755 --- a/build_tools/make_xml_documentation +++ b/build_tools/make_xml_documentation @@ -137,10 +137,12 @@ fi if [ "${command}" = "print_dependencies" ] ; then for subdir in ${mod_subdirs} ; do - subpath="${source_tree}/${subdir}" - # We WANT word splitting in the following line. - # shellcheck disable=SC2046 - ${GREP} -l -E '(language="en_US"|appdocsxml.dtd)' $(${FIND} "${subpath}" -name '*.c' -or -name '*.cc' -or -name '*.xml') || : + case "$subdir" in + /*) subpath="$subdir" ;; + *) subpath="$source_tree/$subdir" ;; + esac + ${FIND} "${subpath}" \( -name '*.c' -o -name '*.cc' -o -name '*.xml' \) \ + -exec ${GREP} -l -E '(language="en_US"|appdocsxml.dtd)' '{}' \; done exit fi