first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / buildor / seek_all_source.sh
1 #!/bin/bash
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 '.').
8
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.
13   find_src_parms[0]="."
14 fi
15
16 #echo "full find_src_parms=${find_src_parms[@]}"
17
18 if [ -z "$SOURCES_FOUND_LIST" ]; then
19   export SOURCES_FOUND_LIST="$(mktemp "$TMP/zz_temp_find_srcs.XXXXXX")"
20 fi
21 # clean up the file to start with.
22 \rm $SOURCES_FOUND_LIST &>/dev/null
23
24 for i in $find_src_parms; do
25 #echo current dir is $i
26   find "$i" -type f -a \( \
27     -iname "*.c" \
28     -o -iname "*.cfg" \
29     -o -iname "*.conf" \
30     -o -iname "*.cpp" \
31     -o -iname "*.css" \
32     -o -iname "*.csv" \
33     -o -iname "*.def" \
34     -o -iname "*.fn2" \
35     -o -iname "*.h" \
36     -o -iname "*.html" \
37     -o -iname "*.ini" \
38     -o -iname "*.inl" \
39     -o -iname "*.java" \
40     -o -iname "*.js" \
41     -o -iname "*.lst" \
42     -o -iname "*.mak" \
43     -o -iname "makefile*" \
44     -o -iname "*.man" \
45     -o -iname "*.pl" \
46     -o -iname "*.r[hc]" \
47     -o -iname "*.rc2" \
48     -o -iname "readme*" \
49     -o -iname "*.sh" \
50     -o -iname "*.sln" \
51     -o -iname "*.txt" \
52     -o -iname "*.vcf" \
53     -o -iname "*.xpm" \
54     -o -iname "*.xml" \
55     \) \
56   | grep -v ".*\.svn.*" >>$SOURCES_FOUND_LIST
57 done
58