2 # this script traverses the directories passed as its parameters and locates
3 # any files that we consider to possibly be source code.
4 # a new variable called "SOURCES_FOUND_LIST" will be declared and will point at
5 # the list of files. this file should be deleted when the caller is done.
6 # due to the variable creation requirement, this script should only be included
7 # in other bash scripts (via 'source' or '.').
9 declare find_src_parms=$*
10 # grab the parameters passed to us.
11 if [ -z "${find_src_parms[0]}" ]; then
12 # if there were no parameters, we will just do the current directory.
16 #echo "full find_src_parms=${find_src_parms[@]}"
18 if [ -z "$SOURCES_FOUND_LIST" ]; then
19 export SOURCES_FOUND_LIST="$(mktemp "$TMP/zz_temp_find_srcs.XXXXXX")"
21 # clean up the file to start with.
22 \rm $SOURCES_FOUND_LIST &>/dev/null
24 for i in $find_src_parms; do
25 #echo current dir is $i
26 find "$i" -type f -a \( \
43 -o -iname "makefile*" \
56 | grep -v ".*\.svn.*" >>$SOURCES_FOUND_LIST