PROMO SELL

Tuesday, March 08, 2005

Some notes on CVS

Setup and run the CVS server

Look for cvs services listed in /etc/servics

# grep cvs /etc/services
cvspserver2401/tcp# CVS client/server operations
cvspserver2401/udp# CVS client/server operations
cvsup 5999/tcpCVSup# CVSup file transfer/John Polstra/FreeBSD
cvsup 5999/udpCVSup# CVSup file transfer/John Polstra/FreeBSD
#

Add cvs pserver to xinted

# cd /etc/xinetd.d/
# cat cvspserver
# service cvspserver
{
socket_type = stream
protocol = tcp
wait = no
user = root
passenv =
server = /usr/bin/cvs
server_args = --allow-root=/cvs pserver -f
}



# /sbin/service xinetd restart
Adding CVS users and CVS passwd file

Used this perl script to generate a password ( you can also use htpasswd )

$ cat passwd.pl

#!/usr/bin/perl -w
$saltchars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./';
while (<>) {
chomp $_;
my ($salt) = substr($saltchars, rand(64), 1) . substr($saltchars, rand(64), 1);
my ($c) = crypt($_, $salt);
print "'$_' => '$c'\n";
}

Generate a password

$ ./passwd.pl
password
'password' => 'OKqq1ib8XEv2E'
$

Add the password into the password file

$ cd $CVSROOT/CVSROOT
$ cat passwd
cvs-user:OKqq1ib8XEv2E:
$

Connecting to the CVS server
Login from another machine like this

$ cvs -d :pserver:cvs-user@serverbox.your.domain.com:/cvs login
(Logging in to cvs-user@serverbox.your.domain.com)
CVS password:
$

Or like this

$setenv CVSROOT :pserver:cvs-user@serverbox.your.domain.com:/cvs
$cvs login

Fixing some common CVS glitches

Got the folowing error:

cvs co -r open-source-product-121-trial-build open-source-product-121
cvs server: cannot open /root/.cvsignore: Permission denied
cvs [server aborted]: can't chdir(/root): Permission denied

Fixed by :

$
#unset HOME
#/etc/rc.d/init.d/inet restart
#/sbin/service xinetd restart

Or by : ( not recommended )

# chmod a+w /root
# chmod a+x /root


Sticky problems


problem:

$ cvs commit -m "adding new version" foobar.c
cvs server: sticky tag 'RELEASE-CANDIDATE-1' for file 'foobar.c' is not a branch
cvs [server aborted]: correct above errors first!
$

fix using an update:

$ cvs update -A foobar.c
M foobar.c
$
$ cvs commit -m "adding new version" foobar.c
Checking in package;
/your/open/source/program/foobar.c,v <-- foobar.c
new revision: 1.2; previous revision: 1.1
done
$


On HP-UX rsh is not the remoteshell remsh is the remote shell,

So you might need to add:

$ setenv CVS_RSH /bin/remsh


Some common CVS commands


$ cd /the/downlaoded/open-source-product/121/source/base/
$ cvs import -m "open-source-product 1.2.1 source import" \
open-source-product-121 FOOBAR open-source-product121
$ cvs checkout open-source-product-121
U open-source-product-121/open-source-product/Makefile.in
....
$ cvs checkout open-source-product-121
$ cvs commit -m "Added FOOBAR specific changes"
Checking in open-source-product/nsprpub/configure;
/cvs/open-source-product-121/open-source-product/nsprpub/configure,v <-- configure
new revision: 1.2; previous revision: 1.1
done
$ cvs -q tag open-source-product-121-trial-build
$ cvs checkout -r open-source-product-121-trial-build open-source-product-121
$ mkdir build
$ cvs add build/
$ cvs -q tag open-source-product-121-trial-build
$ cvs tag -R open-source-product-121-trial-build
$ cvs co -r open-source-product-121-trial-build open-source-product-121

No comments: