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