/[cvs]/eggdrop1.7/misc/killwhitespace
ViewVC logotype

Contents of /eggdrop1.7/misc/killwhitespace

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Mon Nov 20 13:53:32 2006 UTC (12 years, 7 months ago) by tothwolf
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +2 -2 lines
* Updated copyright dates for 2006 (better late than never).

1 #! /bin/sh
2 #
3 # killwhitespace - removes trailing whitespace from source files
4 #
5 # Copyright (C) 2005 - 2006 Eggheads Development Team
6 #
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
25 #
26 # $Id: killwhitespace,v 1.1 2005-08-29 04:38:10 wcc Exp $
27
28 find_whitespace_files() {
29 grep -rE '[[:space:]]+$' . | sed 's/:.*//' | grep '\.[ch]$' | sort | uniq
30 }
31
32 if test ! -f src/main.c; then
33 echo "You are not in the Eggdrop root directory."
34 exit 1
35 fi
36
37 echo -n "Running 'make clean'... "
38 make clean >/dev/null 2>&1
39 echo "done."
40
41 count=0
42 for i in $(find_whitespace_files); do
43 count=$(($count + 1))
44 echo -n "${i}... "
45 sed -e 's:[ \t]*$::g' $i > ${i}_
46 mv ${i}_ $i
47 echo "done."
48 done
49
50 echo "Found/fixed ${count} files."

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23