Posts Tagged ‘cvs’

tinyos git mirror

Friday, February 5th, 2010

TinyOS is one of the projects I currently use, that still use CVS. Luckily I found a git mirror soon after I started using it, but the one I used is not up to date any more. I asked on the TinyOS-devel mailing list to create such a mirror on Sourceforge.net. I am not sure, whether this will happen soon, the first feedback was not very promising. But at least I was pointed to another git mirror, that is well hidden within a lot of irrelevant (for me) lines on the TinyOS wiki. Nevertheless, currently updated git repositories are as follows:

cvs status parser script

Sunday, January 31st, 2010

As other people already found out, the cvs status output sucks pretty much. I found some simple bash scripts to make them a little more useful, but then I quickly wrote a simple MIT-licensed python script that creates an output like modern scms do. It can be downloaded from my Fedorapeople space. Luckily Fedora will anyhow move to git, soon, so I won’t have to use CVS that much anymore then.

It will fail, if files are in a state unknown to the script, but it should cover the most common states (read: the states I found in my cvs checkout). Feel free to report any states that it should handle and I’ll update it.
Here is some example output (I defined an cvss alias for it):

$ cvss
? unknown
O common/Makefile.common
O devel/Makefile
? devel/xz-4.999.8beta
? devel/xz-4.999.8beta.tar.gz
M devel/xz.spec
O EL-5/Makefile

As you can see, it sorts the output and also handles subdirs

cvs via ssh with automatic control socket support

Thursday, December 11th, 2008

A ticket in the Fedora infrastructure request tracker mentioned, that one can use the control socket support of ssh to improve the speed of cvs accesses to Fedora’s cvs. In the ticket, the reporter started manually a ssh that creates a control socket and then uses it with subsequent ssh commands. These ssh commands then do not need to perform a new tcp and ssh handshake and are therefore much faster.

But there was the problem, that the because of some timeout, the socket got killed after around 30 minutes. This is of course pretty annoying. One solution is to create some traffic via the control socket every now and then to keep it open. But then one has still to open the control socket.

I did a little “investigation” and noticed that the ssh command is passed to cvs via the environment variable CVS_SSH. This makes it pretty easy to write a wrapper to first test, whether a control socket exists and to create one, if it does not. Here is what I came up with:


$ cat ~/.ssh/config
Host cvs.fedoraproject.org
ControlMaster auto
ControlPath ~/.ssh/sockets/controlsocket-%h-%p-%r

$ echo $CVS_RSH
/home/till/bin/fedora-cvs-ssh.sh
$ cat bin/fedora-cvs-ssh.sh
#! /bin/bash

SSH_USER=”${2}”
SSH_SERVER=”${3}”

/usr/bin/test -e ~/.ssh/sockets/controlsocket-${SSH_SERVER}-22-${SSH_USER} || /usr/bin/ssh -f -N -l ${SSH_USER} ${SSH_SERVER} </dev/null >/dev/null 2>/dev/null

exec /usr/bin/ssh “$@”

If you extend the ~/.ssh/config file for other hosts, it should work out of the box for every cvs over ssh access that uses port 22. If you want to use a different port, you have to edit it a little.