]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
make_xml_documentation: Properly handle absolute LOCAL_MOD_SUBDIRS.
authorSean Bright <sean@seanbright.com>
Mon, 27 Nov 2023 16:43:15 +0000 (11:43 -0500)
committerSean Bright <sean@seanbright.com>
Tue, 28 Nov 2023 20:02:10 +0000 (20:02 +0000)
If LOCAL_MOD_SUBDIRS contains absolute paths, do not prefix them with
the path to Asterisk's source tree.

Fixes #142

build_tools/make_xml_documentation

index 3446fff0c80c00f4715c02fc1bfe7cfe66a79523..df3f59dc54a031a38d18e419c8baa855a9fadb86 100755 (executable)
@@ -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