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