/CVSROOTccess on cvs execution

I have often had the following issue when connecting to a CVS tree from the command line.

$ cvs up
/CVSROOTccess /usr/local/cvsroot
No such file or directory

The issue is one of line breaks, in that the actual error message that is supposed to be show is:

Cannot access /usr/local/cvsroot
/CVSROOTNo such file or directory

So this post is to help all those out there who have experienced the same issue.  I have found that the issue relates to the files in each of the CVS folders (Root, Entries, Repository)  depending on the client you use (in my case eclipse) to create the files, when you use the command line CVS it fails to interperet the files correctly and gets the wrong path.

I’d guess this is only an issue running CVS on cygwin under windows.  So now i’ve recorded it, all u have to do is dos2unix the files in all the CVS folders and it work a treat. 

dos2unix.exe `find . -name Root`
dos2unix.exe `find . -name Entries`
dos2unix.exe `find . -name Repository`

Will do the trick.

14 Responses

  1. Mark Says:

    Huge save!

    I got screwed because my old install of cygwin was “dos” and the new one was “binary”.

    Thanks!

  2. Jim Says:

    Cool and much better than RTFM ;)
    You went to the point, this is the typical post that makes the internet even better! :)
    I had the same issue as Mark.

    Many thanks also!

  3. Jim Says:

    Oh btw, the three “find” commands fail for paths with spaces in them.
    This is a working alternative:

    find . -name Root -or -name Entries -or -name Repository | while read file; do dos2unix.exe “$file”; done

    regards

  4. edog Says:

    I owe you my first born child… And the few remaining hairs that I havent just pulled out.

  5. Ted Anderson Says:

    Thanks for the tip. Google put your blog entry at the top of the list and it was exactly what I was looking for. I’m feeling lucky!

    To confirm the diagnosis I did:
    % cvs -qn update | & cat -v

    Cannot access /gpfs/fs0/cvs^M/CVSROOT
    No such file or directory
    %

    Cleaning out the ^Ms did the trick.

  6. Jason Cipriani Says:

    Thanks a lot for posting this; and it was the top Google result for “CVSROOTccess” too. Did the trick just fine. PS: This problem is not just Cygwin; I had it using TortoiseCVS + MinGW command line CVS.

  7. Horace Says:

    Thanks for this.

    In a similar vein, this will also work:

    find . -name Root -or -name Entries -or -name Repository | xargs dos2unix

  8. Reihnold Says:

    Thank you very much for this post. It saved me some time recently.

  9. Brian Says:

    THANKS! One point to mention is, I had to type those commands into the Cygwin bash prompt, not the Windows command prompt (that gave me errors). But once I figured that out, it worked like a charm!

  10. Jonathon Says:

    YOU ARE THE MASTER CHIEF!!! THANK YOU SOOOOO MUCH!!!! Like edog said:

    “I owe you my first born child… And the few remaining hairs that I havent just pulled out.”

    So true!!

  11. MeDon Says:

    Hi,
    thanks for the post. I like Horace’s solution. However, it has some problems with filenames with spaces. I have changed it into:

    find . -type f -name Root -or -name Entries -or -name Repository -print0 | xargs -0 dos2unix

    And now it works fine for me. maybe more safe is to use

    find . -type f -path ‘*/CVS/*’ -print0 | xargs -0 dos2unix

    to be sure to process files only in CVS subdirectories.

  12. vineeth starly Says:

    Works like a charm, thanks!

  13. Chad Says:

    That was my problem too.

    I also find this issue occurs when using TortoiseCVS on Windows and checking out files to a samba share on a linux host. If you then ssh to the host and try CVS commands, you’ll get errors because all the files in /CVS are in dos mode, thanks to TortoiseCVS. I haven’t found an option in to make TortoiseCVS use UNIX line endings.

  14. Ying Says:

    THANK YOU SOOOOOOOOOO MUCH! YOU SAVED MY LIFE!

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.