Home | History | Annotate | Line # | Download | only in examples
cvs.1 revision 1.1
      1 The cvs.conf portal configuration file maps the NetBSD anoncvs
      2 respository into the local file system.  This means you can cat(1)
      3 or cp(1) copies of any arbitrary file or revision from the cvs
      4 server using a local path.  Start off like this:
      5 
      6 	# mkdir /p
      7 	# mount -t portal `pwd`/cvs.conf /p
      8 	# chmod +x cvs.pl
      9 	# 
     10 
     11 The next step is to set up the authentication.  The NetBSD anoncvs
     12 server uses ssh for authentication, so all you need to do is
     13 
     14 	# ssh anoncvs (a] anoncvs.netbsd.org
     15 
     16 and answer 'yes' when it asks you if you want to accept the key.
     17 Now the NetBSD source tree is close at hand.
     18 
     19 First, some caveats.  File name completion and globbing don't work,
     20 and diff has difficulties with this since it stat()s the file names
     21 it's given and gets back more or less meaningless information for
     22 names under a portal file system.   You also need to have perl
     23 installed for the cvs.pl script that supports this configuration.
     24 The script expects to find perl in /usr/pkg/bin, so change the
     25 script if you have perl installed somewhere else.
     26 
     27 Here's a list of things I've done with this:
     28 
     29 1) diff one of my files (eg, /etc/security) against the repository
     30 
     31 	% grep NetBSD: /etc/security
     32 	#	$NetBSD: security,v 1.52 ...
     33 	% diff -u -< /p/netbsd/basesrc/etc/security,1.52 /etc/security
     34 	[ diffs elided ]
     35 	% 
     36 
     37 Notice the use of the - file given to diff and the input redirection
     38 so that it will read from stdin instead of opening the file itself.
     39 This gets around the stat() problem.
     40 
     41 2) Check out some (or all) versions of a file:
     42 
     43 	% grep NetBSD: /etc/security
     44 	#	$NetBSD: security,v 1.52 ...
     45 	% foreach i (`jot 10 43`)
     46 	> cp /p/netbsd/basesrc/etc/security,1.$i /tmp
     47 	> end
     48 	% 
     49 
     50 Presto!  Versions 1.43 through 1.52 (jot(1) prints 10 numbers
     51 starting at 43) of /etc/security are copied into your /tmp directory
     52 so that you can do arbitrary diffs between any version you like.
     53 You can use tags instead of revision numbers if you like.
     54 
     55 3) Instant upgrades.  Since cvs always defaults to the head of the
     56 trunk, you can do this:
     57 
     58 	# cp /p/netbsd/basesrc/etc/security /etc/security
     59 	# 
     60 
     61 to upgrade to the latest and greatest version any time you like,
     62 or you can do this:
     63 
     64 	# uname -r
     65 	1.5.2
     66 	# cp /p/netbsd/basesrc/etc/security,netbsd-1-5-PATCH002 /etc/security
     67 	# 
     68 
     69 to get rid of any changes you might have made to /etc/security that
     70 you no longer want.
     71 
     72 Note that there's some support for the FreeBSD and OpenBSD anoncvs
     73 service in there as well, but those might be tricky.  The FreeBSD
     74 anoncvs server only offers pserver access, so you'll need to manually
     75 do a cvs login to make that work.  The OpenBSD server seems to move
     76 around a fair amount, so the CVSROOT value for it will need to be
     77 updated if that happens again.  You might also choose to use
     78 different servers entirely.
     79