You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by "Joerg R. Schaible" <jo...@web.de> on 2003/04/02 00:03:23 UTC

CVS repository with corrupt entries ??

Hi folks,

today I wanted to generate a patch, but I had to detect, that some of the
files in the repsoitory have strang line endings (see my postings because of
the loggers), preventing any usefull diff. Normally cvs will checkout using
the correct line ending for the OS, but see the list of following files now
having DOSish line endings although they should have a normal Unix \n line
ending. In Windows all lines are terminated by \r\r\n. At least for the
files in Fortress I can say, that these files were OK on 22th Feb.

Leo, you did some perl scripting for the @year@? By chance - did you use
Cygwin's perl 5.8.0?

Anyway, these files are no longer in CVS' native repository lf-only
format... (and I've only checked excalibur ...)

Regards,
J�rg


$ cd avalon-excalibur
$ find . -name "*.java" | xargs file | grep CRLF
./compatibility/src/java/org/apache/avalon/excalibur/io/FileUtil.java:
ASCII C program text, with CRLF, LF line terminators
./compatibility/src/test/org/apache/avalon/excalibur/collections/test/Thread
edMapTest.java:                                          ASCII English text,
with CRLF, LF line terminators
./component/src/test/org/apache/avalon/excalibur/component/test/ExcaliburCom
ponentManagerTestCase.java:                              ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/AbstractJdbcCon
nection.java:                                            ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/Abstrac
tDataSourceCluster.java:                                 ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/Default
HashedDataSourceCluster.java:                            ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/Default
IndexedDataSourceCluster.java:                           ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/Default
RoundRobinDataSourceCluster.java:                        ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/HashedD
ataSourceCluster.java:                                   ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/cluster/Indexed
DataSourceCluster.java:                                  ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/DataSourceCompo
nent.java:                                               ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/ids/AbstractDat
aSourceBlockIdGenerator.java:                            ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/ids/AbstractDat
aSourceIdGenerator.java:                                 ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/ids/AbstractIdG
enerator.java:                                           ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/ids/IdGenerator
.java:                                                   ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/ids/SequenceIdG
enerator.java:                                           ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/ids/TableIdGene
rator.java:                                              ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/InformixDataSou
rce.java:                                                ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/J2eeDataSource.
java:                                                    ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionF
actory.java:                                             ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/JdbcConnectionP
ool.java:                                                ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/JdbcDataSource.
java:                                                    ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/PoolSettable.ja
va:                                                      ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitin
gJdbcConnectionPool.java:                                ASCII C program
text, with CRLF line terminators
./datasource/src/java/org/apache/avalon/excalibur/datasource/ResourceLimitin
gJdbcDataSource.java:                                    ASCII C program
text, with CRLF line terminators
./event/src/java/org/apache/excalibur/event/DequeueInterceptor.java:
ASCII C program text, with CRLF line terminators
./event/src/java/org/apache/excalibur/event/impl/LossyMultiCastSink.java:
ASCII C program text, with CRLF line terminators
./event/src/java/org/apache/excalibur/event/impl/MultiCastSink.java:
ASCII C program text, with CRLF line terminators
./event/src/java/org/apache/excalibur/event/impl/RateLimitingPredicate.java:
ASCII C program text, with CRLF line terminators
./event/src/java/org/apache/excalibur/mpool/PoolUtil.java:
ASCII C program text, with CRLF line terminators
./event/src/java/org/apache/excalibur/mpool/Resettable.java:
ASCII C program text, with CRLF line terminators
./extension/src/test/org/apache/avalon/excalibur/extension/test/DeweyDecimal
TestCase.java:                             ASCII C program text, with CRLF
line terminators
./extension/src/test/org/apache/avalon/excalibur/extension/test/ExtensionTes
tCase.java:                                ASCII C program text, with CRLF
line terminators
./extension/src/test/org/apache/avalon/excalibur/extension/test/PackageRepos
itoryTestCase.java:                        ASCII C program text, with CRLF
line terminators
./extension/src/test/org/apache/avalon/excalibur/extension/test/Specificatio
nTestCase.java:                            ASCII C program text, with CRLF
line terminators
./extension/src/test/org/apache/avalon/excalibur/packagemanager/impl/test/Co
mparatorTestCase.java:                     ASCII C program text, with CRLF
line terminators
./extension/src/test/org/apache/avalon/excalibur/packagemanager/impl/test/Te
stExtensionManager.java:                   ASCII C program text, with CRLF
line terminators
./fortress/src/java/org/apache/avalon/fortress/impl/extensions/Instrumentabl
eCreator.java:                             ASCII C program text, with CRLF
line terminators
./fortress/src/java/org/apache/avalon/fortress/impl/handler/AbstractComponen
tHandler.java:                             ASCII C program text, with CRLF
line terminators
./fortress/src/java/org/apache/avalon/fortress/impl/handler/ComponentFactory
.java:                                     ASCII C program text, with CRLF
line terminators
./fortress/src/java/org/apache/avalon/fortress/impl/handler/LEAwareComponent
Handler.java:                              ASCII C program text, with CRLF
line terminators
./fortress/src/java/org/apache/avalon/fortress/impl/lookup/FortressServiceMa
nager.java:                                ASCII C program text, with CRLF
line terminators
./fortress/src/java/org/apache/avalon/fortress/impl/lookup/FortressServiceSe
lector.java:                               ASCII C program text, with CRLF
line terminators
./fortress/src/java/org/apache/avalon/fortress/impl/role/ServiceRoleManager.
java:                                      ASCII C program text, with CRLF
line terminators
./fortress/src/java/org/apache/avalon/fortress/util/Service.java:
ASCII C program text, with CRLF line terminators
./fortress/src/tools/org/apache/avalon/fortress/tools/ComponentMetaInfoColle
ctor.java:                                 ASCII C program text, with CRLF
line terminators
./fortress/src/tools/org/apache/avalon/fortress/tools/ServiceCollector.java:
ASCII C program text, with CRLF line terminators
./instrument/src/test/org/apache/excalibur/instrument/test/LogEnabledInstrum
entableTestCase.java:                      ASCII C program text, with CRLF
line terminators
./loader/src/java/org/apache/excalibur/loader/builder/DefaultLoaderResolver.
java:                                      ASCII C program text, with CRLF
line terminators
./loader/src/java/org/apache/excalibur/loader/builder/LoaderBuilder.java:
ASCII C program text, with CRLF line terminators
./loader/src/java/org/apache/excalibur/loader/builder/LoaderResolver.java:
ASCII C program text, with CRLF line terminators
./loader/src/java/org/apache/excalibur/loader/builder/SimpleLoaderResolver.j
ava:                                       ASCII C program text, with CRLF
line terminators
./loader/src/java/org/apache/excalibur/loader/reader/ClassLoaderSetReader.ja
va:                                        ASCII C program text, with CRLF
line terminators
./monitor/src/test/org/apache/avalon/excalibur/monitor/test/Mock.java:
ASCII C program text, with CRLF line terminators
./monitor/src/test/org/apache/avalon/excalibur/monitor/test/MockOutputStream
.java:                                ASCII C program text, with CRLF line
terminators
./monitor/src/test/org/apache/avalon/excalibur/monitor/test/MockResource.jav
a:                                    ASCII C program text, with CRLF line
terminators
./threadcontext/src/test/org/apache/excalibur/threadcontext/test/ThreadConte
xtTestCase.java:                      ASCII C program text, with CRLF line
terminators




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: CVS repository with corrupt entries ??

Posted by Leo Simons <le...@apache.org>.
Roy Fielding wrote:
 > find . -name \*.java,v -print | xargs perl -pi -e 's/\r//g;'

so I did

ssh leosimons@cvs.apache.org
mkdir ~/cvsbackup
rsync -a /home/cvs/avalon-excalibur ~/cvsbackup
cd /home/cvs/avalon-excalibur
find . -name \*.java,v -print | xargs perl -pi -e 's/\r//g;'

and it seems this has indeed fixed the issue without further problems. 
Let me know when you see anything weird happening, or if there are other 
repos which need fixing.

Stefan Bodewig pointed out that ant has java sources checked in as 
binary, which kind-of makes it not a very good idea to do this 
conversion automatically on checkins.

For people on windows, I found this to confirm Terry's suggestion:

Luke Dunstan wrote:
"I was thinking about the option that someone mentioned in WinCVS that
prevents the line ending conversion, and I found that it works by 
setting the environment variable CVSUSEUNIXLF=1 (equivalent to passing 
the --lf option). This is an undocumented extension to CVS that is only 
included in the CVSNT client, which happens to be the client included as 
part of WinCVS and TortoiseCVS. So TortoiseCVS can be made to behave 
like MSYS CVS by adding the line "cvs --lf" to .cvsrc in the HOME 
directory or by setting the environment variable. Using the environment 
variable seems better if TortoiseCVS is configured to use the same HOME 
directory as MSYS because otherwise MSYS CVS complains about the --lf 
option. So the moral of the story is: never use the official CVS client, 
only CVSNT (www.cvsnt.org) can be configured properly."

so the request is for everyone on windows to set CVSUSEUNIXLF=1. You can 
do that through Start> Control Panel > System > Advanced > Environment 
Variables... if I'm not mistaken.

thanks everyone!

- Leo



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: CVS repository with corrupt entries ??

Posted by Leo Simons <le...@apache.org>.
Hi infrastructure,

some of the files in avalons CVSes are somewhat corrupt: they contain a 
CRCRLF sequence for End-Of-Line, instead of just LF. From a quick glance 
this appears to happen in several of the repos, not just 4 avalon. I 
would like to run a simple script on the cvs box that fixes all this 
(maybe something to trigger on each commit, even?), but I'm still sucky 
at perl so I'm having a little trouble coming up with a neat script....

Jörg Schaible wrote:
> using a bash it is quite easier ...
> 
> find . -name "*.java" | xargs d2u

if only icarus had dos2unix installed :D

any freebsd or perl wizard who can help out here? IOW, I need the 
commandline equiv of

<fixcrlf
     srcdir="/home/cvs/avalon-excalibur"
     includes="**/*.java,v"
     eol="lf"
     eof="remove"/>

in Ant.

thanks!

- Leo



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: CVS repository with corrupt entries ??

Posted by J�rg Schaible <jo...@gmx.de>.
Leo Simons wrote:
> Leo Simons wrote:
>> I know Peter Royal corrects line endings on files every so often,
>> but I don't know what it is that corrupts them.
>
> on closer inspection it seems there's a few version combos of ssh+cvs
> that result in this problem, as do some editors. I've spent half an
> hour on a little perl script to fix the repo, but it doesn't actually
> work and I'm real bored with it atm. In the meantime, he're an ant
> snippet which fixes the files locally and allows you to send in your
> patches.
>
> <project default="main">
> <target name="fixCRLF">
> <fixcrlf
>      srcdir="."
>      includes="**/*.java"
>      eol="lf"
>      tab="remove"
>      tablength="4"
>      eof="remove"/>
> </target>
> </project>
>
> cheers,

Hi Leo,

using a bash it is quite easier ...

find . -name "*.java" | xargs d2u

and if you're in Windows using Cygwin on a textmounted drive (i.e. text mode
crlf translation) just reverse it again

find . -name "*.java" | xargs u2d

d2u will produce valid lf-ended files on any case :)

Regards,
J�rg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: CVS repository with corrupt entries ??

Posted by Leo Simons <le...@apache.org>.
Leo Simons wrote:
> I know Peter Royal corrects line endings on files every so often, but I 
> don't know what it is that corrupts them.

on closer inspection it seems there's a few version combos of ssh+cvs 
that result in this problem, as do some editors. I've spent half an hour 
on a little perl script to fix the repo, but it doesn't actually work 
and I'm real bored with it atm. In the meantime, he're an ant snippet 
which fixes the files locally and allows you to send in your patches.

<project default="main">
<target name="fixCRLF">
<fixcrlf
     srcdir="."
     includes="**/*.java"
     eol="lf"
     tab="remove"
     tablength="4"
     eof="remove"/>
</target>
</project>

cheers,

- LSD



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: CVS repository with corrupt entries ??

Posted by Peter Donald <pe...@realityforge.org>.
On Wed, 2 Apr 2003 17:29, Leo Simons wrote:
> I know Peter Royal corrects line endings on files every so often, but I
> don't know what it is that corrupts them. Never really bothered to think
> about it.

Berins editor corrupts them.

-- 
Cheers,

Peter Donald
*-----------------------------------------------------------*
"I like nonsense, it wakes up the brain cells. Fantasy is a 
necessary ingredient in living, it's a way of looking at life 
through the wrong end of a telescope and that enables you to 
laugh at life's realities." -Dr. Seuss
*-----------------------------------------------------------*



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Re: CVS repository with corrupt entries ??

Posted by Leo Simons <le...@apache.org>.
Joerg R. Schaible wrote:
> Hi folks,
> 
> today I wanted to generate a patch, but I had to detect, that some of the
> files in the repsoitory have strang line endings (see my postings because of
> the loggers), preventing any usefull diff. Normally cvs will checkout using
> the correct line ending for the OS, but see the list of following files now
> having DOSish line endings although they should have a normal Unix \n line
> ending. In Windows all lines are terminated by \r\r\n. At least for the
> files in Fortress I can say, that these files were OK on 22th Feb.

weird.

> Leo, you did some perl scripting for the @year@? By chance - did you use
> Cygwin's perl 5.8.0?

nope. I used jEdit with jdk1.4.1 for that, which is supposed to know 
about line endings......

I know Peter Royal corrects line endings on files every so often, but I 
don't know what it is that corrupts them. Never really bothered to think 
about it.

It should be easy enough to run some fixCRLF util on the repo (I know 
ant has such a task...). Maybe I'll have a look this weekend.

- Leo



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org