-
Notifications
You must be signed in to change notification settings - Fork 78
/
fixup.sh
executable file
·170 lines (149 loc) · 5.24 KB
/
fixup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#!/bin/sh
# fix DOS/Unix names and Subversion EOL-Style, and remove backup files
#DOS2UNIX=/usr/bin/dos2unix
DOS2UNIX=/usr/bin/fromdos
# exit silently if utility is not installed
[ -x ${DOS2UNIX} ] || exit 0
[ -x /usr/bin/svn ] || exit 0
directory=${1-`pwd`}
for filename in $( find ${directory} -name '*.c' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/plain ${filename}
done
for filename in $( find ${directory} -name '*.h' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/plain ${filename}
done
for filename in $( find ${directory} -name '*.bat' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/plain ${filename}
done
for filename in $( find ${directory} -name '*.pl' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/x-script.perl ${filename}
done
for filename in $( find ${directory} -name '*.eww' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/xml ${filename}
done
for filename in $( find ${directory} -name '*.ewp' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/xml ${filename}
done
for filename in $( find ${directory} -name '*.cbp' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/xml ${filename}
done
for filename in $( find ${directory} -name '*.icf' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/plain ${filename}
done
for filename in $( find ${directory} -name '*.htm' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/html ${filename}
done
for filename in $( find ${directory} -name '*.txt' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/plain ${filename}
done
for filename in $( find ${directory} -name '*.lua' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/plain ${filename}
done
for filename in $( find ${directory} -name '*.sh' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/x-script.sh ${filename}
done
for filename in $( find ${directory} -name '*.b32' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/x-makefile ${filename}
done
for filename in $( find ${directory} -name '*.mak' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/x-makefile ${filename}
done
for filename in $( find ${directory} -name 'Makefile' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propset svn:eol-style native ${filename}
/usr/bin/svn propset svn:mime-type text/x-makefile ${filename}
done
for filename in $( find ${directory} -name '*.xls' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propdel svn:eol-style ${filename}
/usr/bin/svn propset svn:mime-type application/excel ${filename}
done
for filename in $( find ${directory} -name '*.ods' )
do
echo Fixing DOS/Unix ${filename}
${DOS2UNIX} ${filename}
echo Setting Subversion EOL Style for ${filename}
/usr/bin/svn propdel svn:eol-style ${filename}
/usr/bin/svn propset svn:mime-type application/vnd.oasis.opendocument.spreadsheet ${filename}
done
for filename in $( find ${directory} -name '*~' )
do
echo Removing backup ${filename}
rm ${filename}
done