Mercurial > mplayer.hg
annotate TOOLS/checktree.sh @ 16312:c8e32af14a6f
X11 can use pthread (fixes --enable-static)
author | henry |
---|---|
date | Fri, 26 Aug 2005 19:00:36 +0000 |
parents | d4cf25d45b13 |
children | 13ac8d0ba7fd |
rev | line source |
---|---|
16240
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
1 #!/bin/sh |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
2 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
3 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
4 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
5 # Check source-tree for anomalies |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
6 # |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
7 # (C)opyright 2005 by Ivo van Poorten |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
8 # Licensed under GNU General Public License version 2 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
9 # |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
10 # Thanks to Melchior Franz of the FlightGear project for the original idea |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
11 # of a source-tree checker and Torinthiel for the feedback along the way. |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
12 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
13 # $Id$ |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
14 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
15 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
16 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
17 # Default settings |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
18 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
19 _spaces=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
20 _extensions=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
21 _crlf=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
22 _trailws=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
23 _rcsid=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
24 _oll=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
25 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
26 _color=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
27 _head=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
28 _cvs=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
29 _files= |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
30 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
31 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
32 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
33 # Avoid locale problems |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
34 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
35 export LC_ALL=C |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
36 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
37 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
38 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
39 # Helper functions |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
40 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
41 enable_all_tests() { |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
42 _spaces=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
43 _extensions=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
44 _crlf=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
45 _trailws=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
46 _rcsid=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
47 _oll=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
48 } |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
49 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
50 disable_all_tests() { |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
51 _spaces=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
52 _extensions=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
53 _crlf=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
54 _trailws=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
55 _rcsid=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
56 _oll=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
57 } |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
58 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
59 printoption() { |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
60 echo " -(no)$1 $2 [default: $3]" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
61 } |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
62 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
63 printhead() { |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
64 test "$_head" = "yes" && echo -e "$COLB$1$COLE" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
65 } |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
66 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
67 all_filenames() { |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
68 test "$_files" != "" && echo "$_files" && return |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
69 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
70 if [ "$_cvs" == "no" ]; then |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
71 find . -type f \ |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
72 | grep -v "\.\#\|\~$\|\.depend\|\/CVS\/\|config.mak\|^\./config\.h" \ |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
73 | grep -v "^\./version\.h\|\.o$\|\.a$" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
74 else |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
75 list_cvs . |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
76 fi |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
77 } |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
78 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
79 list_cvs() { |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
80 for i in `grep "^/" $1/CVS/Entries | cut -d '/' -f 2`; do |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
81 echo $1/$i |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
82 done |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
83 for j in `grep "^D/" $1/CVS/Entries | cut -d '/' -f 2`; do |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
84 list_cvs $1/$j |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
85 done |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
86 } |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
87 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
88 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
89 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
90 # Parse command line |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
91 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
92 for i in "$@"; do |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
93 case "$i" in |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
94 -help) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
95 echo -e "\n$0 [options] [files]\n" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
96 echo -e "options:\n" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
97 printoption "spaces " "test for spaces in filenames" "$_spaces" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
98 printoption "extensions" "test for uppercase extensions" "$_extensions" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
99 printoption "crlf " "test for MSDOS line endings" "$_crlf" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
100 printoption "trailws " "test for trailing whitespace" "$_trailws" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
101 printoption "rcsid " "test for missing RCS Id's" "$_rcsid" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
102 printoption "oll " "test for overly long lines" "$_oll" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
103 echo |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
104 printoption "all " "enable all tests" "no" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
105 echo |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
106 printoption "color " "colored output" "$_color" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
107 printoption "head " "print heading for each test" "$_head" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
108 printoption "cvs " "use CVS/ to determine which files to check" \ |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
109 "$_cvs" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
110 echo -e "\nIf no files are specified, the whole tree is traversed." |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
111 echo -e "If there are, -(no)cvs has no effect.\n" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
112 exit |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
113 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
114 -oll) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
115 _oll=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
116 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
117 -nooll) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
118 _oll=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
119 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
120 -cvs) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
121 _cvs=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
122 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
123 -nocvs) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
124 _cvs=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
125 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
126 -head) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
127 _head=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
128 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
129 -nohead) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
130 _head=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
131 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
132 -color) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
133 _color=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
134 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
135 -nocolor) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
136 _color=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
137 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
138 -spaces) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
139 _spaces=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
140 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
141 -nospaces) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
142 _spaces=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
143 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
144 -extensions) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
145 _extensions=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
146 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
147 -noextensions) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
148 _extensions=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
149 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
150 -crlf) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
151 _crlf=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
152 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
153 -nocrlf) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
154 _crlf=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
155 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
156 -trailws) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
157 _trailws=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
158 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
159 -notrailws) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
160 _trailws=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
161 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
162 -rcsid) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
163 _rcsid=yes |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
164 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
165 -norcsid) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
166 _rcsid=no |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
167 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
168 -all) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
169 enable_all_tests |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
170 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
171 -noall) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
172 disable_all_tests |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
173 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
174 -none) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
175 disable_all |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
176 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
177 -*) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
178 echo "unknown option: $i" >&2 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
179 exit 0 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
180 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
181 *) |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
182 _files="$_files $i" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
183 ;; |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
184 esac |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
185 done |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
186 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
187 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
188 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
189 # Set heading color |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
190 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
191 if [ "$_color" == "yes" ]; then |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
192 COLB="\e[36m" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
193 COLE="\e[m" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
194 else |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
195 COLB="" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
196 COLE="" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
197 fi |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
198 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
199 # Generate filelist once so -cvs isn't _that_ much slower than -nocvs anymore |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
200 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
201 filelist=`all_filenames` |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
202 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
203 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
204 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
205 # DO CHECKS |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
206 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
207 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
208 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
209 if [ "$_spaces" == "yes" ]; then |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
210 printhead "checking for spaces in filenames ..." |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
211 find . | grep " " |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
212 fi |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
213 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
214 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
215 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
216 if [ "$_extensions" == "yes" ]; then |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
217 printhead "checking for uppercase extensions ..." |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
218 echo $filelist | grep "\.[[:upper:]]\+$" | grep -v "\.S$" |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
219 fi |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
220 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
221 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
222 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
223 if [ "$_crlf" == "yes" ]; then |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
224 printhead "checking for MSDOS line endings ..." |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
225 grep -l -I " |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
226 " $filelist |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
227 fi |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
228 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
229 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
230 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
231 if [ "$_trailws" == "yes" ]; then |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
232 printhead "checking for trailing whitespace ..." |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
233 grep -l -I "[[:space:]]\+$" $filelist |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
234 fi |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
235 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
236 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
237 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
238 if [ "$_rcsid" == "yes" ]; then |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
239 printhead "checking for missing RCS \$Id\$ or \$Revision\$ tags ..." |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
240 grep -L -I "\$\(Id\|Revision\)[[:print:]]\+\$" $filelist |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
241 fi |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
242 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
243 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
244 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
245 if [ "$_oll" == "yes" ]; then |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
246 printhead "checking for overly long lines (over 79 characters) ..." |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
247 grep -l -I "^[[:print:]]\{80,\}$" $filelist |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
248 fi |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
249 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
250 # ----------------------------------------------------------------------------- |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
251 |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
252 # End |
d4cf25d45b13
Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff
changeset
|
253 |