ovl: do not cleanup directory and whiteout index entries
[linux/fpc-iii.git] / scripts / check_00index.sh
blob6ac9527aeddb5e9d284e6f1cc2e0234aa33eb087
1 #!/bin/bash
3 cd Documentation/
5 # Check entries that should be removed
7 obsolete=""
8 for i in $(tail -n +12 00-INDEX |grep -E '^[a-zA-Z0-9]+'); do
9 if [ ! -e $i ]; then
10 obsolete="$obsolete $i"
12 done
14 # Check directory entries that should be added
15 search=""
16 dir=""
17 for i in $(find . -maxdepth 1 -type d); do
18 if [ "$i" != "." ]; then
19 new=$(echo $i|perl -ne 's,./(.*),$1/,; print $_')
20 search="$search $new"
22 done
24 for i in $search; do
25 if [ "$(grep -P "^$i" 00-INDEX)" == "" ]; then
26 dir="$dir $i"
28 done
30 # Check file entries that should be added
31 search=""
32 file=""
33 for i in $(find . -maxdepth 1 -type f); do
34 if [ "$i" != "./.gitignore" ]; then
35 new=$(echo $i|perl -ne 's,./(.*),$1,; print $_')
36 search="$search $new"
38 done
40 for i in $search; do
41 if [ "$(grep -P "^$i\$" 00-INDEX)" == "" ]; then
42 file="$file $i"
44 done
46 # Output its findings
48 echo -e "Documentation/00-INDEX check results:\n"
50 if [ "$obsolete" != "" ]; then
51 echo -e "- Should remove those entries:\n\t$obsolete\n"
52 else
53 echo -e "- No obsolete entries\n"
56 if [ "$dir" != "" ]; then
57 echo -e "- Should document those directories:\n\t$dir\n"
58 else
59 echo -e "- No new directories to add\n"
62 if [ "$file" != "" ]; then
63 echo -e "- Should document those files:\n\t$file"
64 else
65 echo "- No new files to add"