projects
/
feisty_meow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'release-2.140.131' into dev
[feisty_meow.git]
/
scripts
/
buildor
/
buildor_count_code.sh
diff --git
a/scripts/buildor/buildor_count_code.sh
b/scripts/buildor/buildor_count_code.sh
index 2d8c894e9b39518d01b4ee3edee5d72aaa092a26..3bd9fcedb32388983df48385586059bb858606e2 100644
(file)
--- a/
scripts/buildor/buildor_count_code.sh
+++ b/
scripts/buildor/buildor_count_code.sh
@@
-2,12
+2,13
@@
TOTALS=0
TOTALS=0
-codefile_list=(.c .cpp .h .java .pl .py .sh)
+codefile_list=(.c .cpp .h .java .pl .py .sh .wsdl .gwsdl .xml .properties .config .configuration .txt makefile\* )
+
for ((i=0 ; i < ${#codefile_list[@]}; i++)); do
if [ ! -z "$phrases" ]; then
phrases="$phrases -o"
fi
for ((i=0 ; i < ${#codefile_list[@]}; i++)); do
if [ ! -z "$phrases" ]; then
phrases="$phrases -o"
fi
- phrases="$phrases -iname *${codefile_list[i]}"
+ phrases="$phrases -iname
\
*${codefile_list[i]}"
done
#echo phrases is now $phrases
done
#echo phrases is now $phrases
@@
-15,26
+16,26
@@
while true; do
export NAME_LIST_TEMP_FILE="$(mktemp "$TMP/zz_code_count.XXXXXX")"
dir="$1"; shift
export NAME_LIST_TEMP_FILE="$(mktemp "$TMP/zz_code_count.XXXXXX")"
dir="$1"; shift
-
if [ -z "$dir" ]; then
if [ -z "$dir" ]; then
+ rm $NAME_LIST_TEMP_FILE
+
break;
fi
break;
fi
-
#echo dir is $dir
#echo dir is $dir
-#set -o xtrace
-##hmmm: how to turn off tracing thing?
-
- find "$dir" -type f $phrases >$NAME_LIST_TEMP_FILE
+ # for some reason we had to add an eval in front to get this
+ # working after escaping the asterisk (so as not to include
+ # local files that matched the patterns).
+
eval
find "$dir" -type f $phrases >$NAME_LIST_TEMP_FILE
#echo ====================================================
#echo ====================================================
-#echo file holds these matches:
+#echo file
$NAME_LIST_TEMP_FILE
holds these matches:
#cat $NAME_LIST_TEMP_FILE
#echo ====================================================
#cat $NAME_LIST_TEMP_FILE
#echo ====================================================
- while read
line
; do
-#echo
line is $line
- count=$(grep -h -v -c "^[ ]*$" $
line
)
+ while read
input_text
; do
+#echo
input_text is $input_text
+ count=$(grep -h -v -c "^[ ]*$" $
input_text
)
TOTALS=$(($TOTALS + $count))
#echo total is $TOTALS now
done < "$NAME_LIST_TEMP_FILE"
TOTALS=$(($TOTALS + $count))
#echo total is $TOTALS now
done < "$NAME_LIST_TEMP_FILE"