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