Search code examples
bashversion-controlcvs

CVSROOT not read by cvs


We have a CVS server on a remote machine for which I have a line in .bashrc:

export CVSROOT=:pserver:myuser@theserver:/home/cvs

Bash confirms that this is set:

$ echo $CVSROOT
:pserver:myuser@theserver:/home/cvs

I've also got a local CVS repo that I used for some other stuff

/home/myuser/repo-cvs

Which I would access doing (so to override the default in $CVSROOT):

cvs -d /home/myuser/repo-cvs co projA

When I execute any cvs command without -d , I expect it to use the one define in $CVSROOT, but I get stuff like this:

$ cvs login
cvs login: can only use `login' command with the 'pserver' method
cvs [login aborted]: CVSROOT: /home/myuser/repo-cvs

$ cvs co tools
cvs checkout: cannot find module `tools' - ignored

This works however (tools is on the pserver not the local):

$ cvs -d $CVSROOT tools
cvs checkout: Updating tools/
...

So it clearly ignores the env var $CVSROOT

I've deleted ~/.cvspass because it had references to both, I cannot find any other location where this kind of info could be cached/stored.

Any ideas?

Additional Notes

I do not have any overrides set as an alias in bashrc or in .cvsrc

$ cvs -v
Concurrent Versions System (CVS) 1.12.13-MirDebian-11 (client/server)

Solution

  • I made two assumptions:

    1. I assumed if you don't specify -d it would next use $CVSROOT based on CVS man page:

      -d cvs_root_directory
      Use cvs_root_directory as the root directory pathname of the repository. Overrides the setting of the $CVSROOT environment variable.

    2. The directories in which I ran the cvs commands was

      ~/tmp ~/dev/projects

    both locations in which I didnt expect the CVS/ local dirs; I expect them like this:

    ~/dev/projects/myProjA/CVS
    

    I'm guessing if I spend the time I'll find something in the manual that explains that a cvs command will look at the local revision info dir CVS/ before it looks at $CVSROOT