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