moved for svn-git switch
[mailer.git] / todo-builder.sh
1 #!/bin/sh
2
3 # This script helps building the file DOCS/TODOs.txt and should be executed by
4 # developers with SVN write-access
5
6 if ! test -e "modules.php"; then
7         echo "$0: Please execute this script from root directory."
8         exit 1
9 fi
10
11 TODO="DOCS/TODOs.txt"
12 LOG="DOCS/template-warnings.log"
13
14 echo "$0: Generating TODOs.txt ..."
15 echo "### WARNING: THIS FILE IS AUTO-GENERATED BY $0 (uid=${UID}/user=${USER}) ###" > ${TODO}
16 echo "### DO NOT EDIT THIS FILE. ###" >> ${TODO}
17 echo "$0: Searching for @TODO ..."
18 find -type f -name "*.php" -exec grep -Hin "@TODO" {} \; | sort >> ${TODO}
19 find -type f -name "*.tpl" -exec grep -Hin "@TODO" {} \; | sort >> ${TODO}
20 find -type f -name "*.xml" -exec grep -Hin "@TODO" {} \; | sort >> ${TODO}
21 find -type f -name "*.js" -exec grep -Hin "@TODO" {} \; | sort >> ${TODO}
22 find -type f -name ".htaccess" -exec grep -Hin "@TODO" {} \; | sort >> ${TODO}
23 echo "### ### DEPRECATION FOLLOWS: ### ###" >> ${TODO}
24 echo "$0: Searching for @DEPRECATED ..."
25 find -type f -name "*.php" -exec grep -Hin "@DEPRECATED" {} \; | sort >> ${TODO}
26 find -type f -name "*.tpl" -exec grep -Hin "@DEPRECATED" {} \; | sort >> ${TODO}
27 find -type f -name "*.xml" -exec grep -Hin "@DEPRECATED" {} \; | sort >> ${TODO}
28 find -type f -name "*.js" -exec grep -Hin "@DEPRECATED" {} \; | sort >> ${TODO}
29 find -type f -name ".htaccess" -exec grep -Hin "@DEPRECATED" {} \; | sort >> ${TODO}
30 echo "$0: Checking for template-warnings.log ..."
31 if test -e "${LOG}"; then
32         echo "$0: Found a template-warnings.log, adding it..."
33         echo "### ### template-warnings.log follows: ### ###" >> ${TODO}
34         cat ${LOG} >> ${TODO}
35 fi
36 echo "$0: Done."
37 exit 0