CRLF in the CVS (was Re: [Anjuta-devel] Re: [Anjuta-list] what about the anjuta development?)



Ok naba .. I told you several times that those CRLF files in CVS were bad
karma .. that's one more proof :-)

I hope we can take steps to settle this. On my CVS servers, I run a script
that checks the validity of the files after each commit. This way we are
warned as soon as something goes wacky with the CRLF. It may be useful so
I have attached it.

TTimo

On 15 Jul 2002 10:34:32 -0400
Nicolas Laplante <nicolas laplante sympatico ca> wrote:

> On Mon, 2002-07-15 at 04:02, Timothee Besset wrote:
> > Well actually, now it is attached
> > 
> > On Mon, 15 Jul 2002 09:58:39 +0200
> > Timothee Besset <ttimo idsoftware com> wrote:
> > 
> > To be honest, gcc not supporting \ in macros .. this is weird. I'd like
> > you to try something: make sure those files are in the unix format. I have
> > noticed several times that we have some CRLF files (i.e. dos text format)
> > in the CVS source.
> > 
> > I could never convince naba to clean this up because it is a bad thing.
> > Actually one of the consequences is to break the multiline macros in the C
> > preprocessor (at least on some OSes / versions).
> > 
> > I'd like you to check and confirm that for us.
> > 
> > What I usually do to cleanup my source:
> > 
> > find . -name '*.c' -exec file {} \; | grep CRLF
> > find . -name '*.cxx' -exec file {} \; | grep CRLF
> > 
> > when you locate those faulty CRLF files, you can cleanup with undos (I've
> > attached it)
> > 
> > TTimo
> 
> In fact I've run:
> 
> find . -name *.c -exec file {} \; | grep CRLF | cut -f1 -d: | xargs
> undos
> 
> I've done it for .h, .c, .cxx and .py files and now it build without
> errors.
> 
> I noticed that GNU indent does put some CRLF some times in source code.
> 
> Nicolas
> 
#!/bin/sh
FILE=/tmp/cr_hunter$$.log
rm -f $FILE
for i in *.h *.c *.cpp
do
  find $1 -name $i -exec file {} \; | grep CRLF >> $FILE
done

OUT=`cat $FILE`
if [ "x$OUT" != "x" ] 
then
  echo -e "This is an automated message generated by the commit script on zerowing:\n\nGot the following bad files in last checkin:\n\n$OUT" | mail -s 'CR Hunter is angry' gtkradiant zerowing idsoftware com
fi
rm -f $FILE


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]