17

Apparently, Apple has removed CVS under the OS X 10.9 Mavericks devtools (and yes, it's really gone). For the uninitiated, CVS is the Concurrent Version System, a tool for keeping files up to date between different machines and users (developers).

I have some legacy projects that still require it (no, I cannot change it to use SVN, much less git).

Where is the best place to get a version that works under OS X Mavericks?

  • Did you check whether it is still in /usr/bin/cvs? – nohillside Nov 4 '13 at 8:52
  • Yep, it's really gone. – Andrew Jaffe Nov 4 '13 at 8:56
16

The easiest way for most programs is to install with a package manager like Macports, Homebrew or Fink. The porters will have worked out the issues about porting the code to OSX so it should be as simple as follows (for Macports)

  1. Install macports, download the .pkg file and run it
  2. Install Xcode and its command line tools
  3. Add /opt/local/bin to your path - the installer attempts to do this for you so you probably just need to check
  4. Install the port sudo port install cvs
  5. Run cvs either with the full path /opt/local/bin/cvs or use your PATH
16

A unix-ish package manager is clearly the way to go. I have moved from fink and Macports to homebrew, which has a recipe for cvs:

brew install cvs

For historical completeness, you formerly had to use the (slightly hard to find) recipe for cvs: brew install homebrew/dupes/cvs.

After only very minimal testing, it seems to work.

  • 3
    I tried the slightly shorter command brew install cvs (OS 10.9, Homebrew 0.9.5); it installed CVS 1.12.13, which appears to work. – nknight Dec 11 '13 at 0:59
  • 3
    Yes, nknight's command is the right one. The command has changed because the CVS formula has moved from homebrew-dupes to Homebrew core in November 2013. – herzbube Aug 16 '14 at 17:01
2

edit: As remarked in the comments git requires a working cvs client which makes this approach just a nice interop layer but not a solution to the problem of a missing csv client.

Another option would be to use git as a cvs client and directly push to the CVS server.

Depending on your needs this could be sufficient cvs interop + a advantage of using git locally.

  • I had no idea you could do that. Very cool! – Andrew Jaffe Nov 5 '13 at 11:47
  • 2
    I tried this, but git-cvsimport seems to require a CVS client, so it's a chicken and egg problem. – David Moles Jan 29 '15 at 23:35
  • 1
    Thanks @DavidMoles. I have changed the answer to make sure that everybody is aware of this limitation. I did not try it myself before. – OliverS Jan 30 '15 at 8:26
0

CVSNT runs on Mac OS X 10.9, and supports HQX encoding of resources etc. Beta for 10.9 is available here: http://march-hare.com/cvspro/#downcvsnt

If you previously used Mac CVS X then this (CVSNT) is the 'command line' that was previously included.

0

I just had this same problem, and a big issue with Macports, Fink etc. is that they pull in lots of other depedencies which is confusing and unnecessary if all you need is a single tool like cvs. In my case, trying to install it using macports resulted in a popup asking me to install a java compiler (?!) and dozens of other packets had to be built so I quickly pulled eject :)

If all you need is cvs, just building it yourself is easy and more clean and the resulting binary integrates with all the existing libs etc. on the computer. You do need Xcode installed and its command-line tools, but if you need cvs, I'm sure you already have this installed.

Get the cvs sourcecode from:

http://download.savannah.gnu.org/releases/cvs/source/stable/1.11.23/

un-tar it into a folder, enter the folder, and run ./configure

You then (unfortunately) need to edit the files in src/ and lib/ to rename their getline function into, say, getlineX, because getline clashes with a libc function. I could do a patch of this and put somewhere I guess..

After this, do "make" and you will get a binary in src/cvs that you can put in your ~/bin folder or wherever, and make sure your PATH points there.

  • > I could do a patch of this and put somewhere I guess.     That would be nice, and worth submitting back. (Not urgent for me, I generally have good luck with Homebrew.) – Flash Sheridan Jan 30 '16 at 21:17
0

Following up on BjornW's answer with a patch.

After downloading and unarchiving the source from: http://download.savannah.gnu.org/releases/cvs/source/stable/1.11.23/

Copy the patch below to some file, say, cvs-1.11.23.patch, then apply the patch with:

patch -d cvs-1.11.23 -p1 < cvs-1.11.23.patch

Then build as per the cvs-1.11.23 README file instructions:

cd cvs-1.11.23
./configure
make
make install

Here's the patch:

diff -r -u cvs-1.11.23/lib/getline.c cvs-1.11.23-osx/lib/getline.c
--- cvs-1.11.23/lib/getline.c   2005-04-05 06:46:05.000000000 +1000
+++ cvs-1.11.23-osx/lib/getline.c       2017-01-31 12:04:19.000000000 +1100
@@ -154,13 +154,10 @@
   return ret;
 }

-int
-getline (lineptr, n, stream)
-     char **lineptr;
-     size_t *n;
-     FILE *stream;
+ssize_t
+     getline(char ** restrict lineptr, size_t * restrict linecapp, FILE *     restrict stream)
 {
-  return getstr (lineptr, n, stream, '\n', 0, GETLINE_NO_LIMIT);
+  return (ssize_t)getstr (lineptr, linecapp, stream, '\n', 0, GETLINE_NO_LIMIT);
 }

 int
diff -r -u cvs-1.11.23/lib/getline.h cvs-1.11.23-osx/lib/getline.h
--- cvs-1.11.23/lib/getline.h   2005-04-05 06:46:05.000000000 +1000
+++ cvs-1.11.23-osx/lib/getline.h       2017-01-31 12:03:21.000000000 +1100
@@ -11,8 +11,8 @@    

 #define GETLINE_NO_LIMIT -1

-int
-  getline __PROTO ((char **_lineptr, size_t *_n, FILE *_stream));
+ssize_t
+  getline(char ** restrict linep, size_t * restrict linecapp, FILE * restrict stream);
 int
   getline_safe __PROTO ((char **_lineptr, size_t *_n, FILE *_stream,
                      int limit));

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .