Jeremias Maerki wrote:

> up a few patch submissions. While applying them I ran across several
> files that had CRCRLF endings instead of CRLF when checked out using
> WinCVS on a Windows box. I think I have successfully corrected those I
> ran into. Does anyone have a good idea how to...
> 1. identify files not having correct linevindingstlithoutckaving
> de opendeach an>every file?

I have never been able to get grep to detect them. The only way I know (and
it falls into the category of "beat it to death") is to convert each file
using tr, then compare it to the old one. Here is a script that I just ran
on my box that works:

cd /u/vic/fop-trunk
for I in `find . -type f`
do
  cat $I | tr -d "\015" > /u/tmp/QQtest
  DELTA=`diff $I /u/tmp/QQtest | wc -l`
  if [ $DELTA -gt 0 ]
  then
    echo "$I has DOS line-endings"
  fi
done
rm /u/tmp/QQtest

It will include binary files in its output as well. If that is a problem,
add a test to exclude those from consideration (probably using the "file"
command and looking for the word "text").

Since I have a hybrid Linux/Windows environment here, I feel like the
apostles at the Last Supper ("Lord, is it I?").

Also, if you want to clean up the files in the repository, I understand that
running "cvs admin -kkv FILE" will do so. This will tell cvs to treat the
files as text files instead of binary, which is apparently the root of the
problem. (I know, -k is for keywords, but cvs has keywords conversions &
line-ending conversions in the same space). Make sure you're backed up & do
some testing to make sure you got what you want.

Victor Mote



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to