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