NetBSD/sbin/mount_portal/examples/cvs.1

72 lines
2.2 KiB
Groff
Raw Normal View History

$NetBSD: cvs.1,v 1.7 2017/05/09 23:26:49 kamil Exp $
The cvs.conf portal configuration file maps the NetBSD anoncvs
respository into the local file system. This means you can cat(1)
or cp(1) copies of any arbitrary file or revision from the cvs
server using a local path. Start off like this:
# mkdir /p
# mount -t portal `pwd`/cvs.conf /p
2001-11-16 13:25:42 +03:00
#
The next step is to set up the authentication. The NetBSD anoncvs
server uses ssh for authentication, so all you need to do is
2003-07-26 23:38:45 +04:00
# ssh anoncvs@anoncvs.NetBSD.org
and answer 'yes' when it asks you if you want to accept the key.
Now the NetBSD source tree is close at hand.
First, some caveats. File name completion and globbing don't work,
and diff has difficulties with this since it stat()s the file names
it's given and gets back more or less meaningless information for
names under a portal file system.
Here's a list of things I've done with this:
1) diff one of my files (eg, /etc/security) against the repository
% grep NetBSD: /etc/security
# $NetBSD: security,v 1.52 ...
2007-07-02 20:56:37 +04:00
% diff -u -< /p/netbsd/src/etc/security,1.52 /etc/security
[ diffs elided ]
2001-11-16 13:25:42 +03:00
%
Notice the use of the - file given to diff and the input redirection
so that it will read from stdin instead of opening the file itself.
This gets around the stat() problem.
2) Check out some (or all) versions of a file:
% grep NetBSD: /etc/security
# $NetBSD: security,v 1.52 ...
% foreach i (`jot 10 43`)
2007-07-02 20:56:37 +04:00
> cp /p/netbsd/src/etc/security,1.$i /tmp
> end
2001-11-16 13:25:42 +03:00
%
Presto! Versions 1.43 through 1.52 (jot(1) prints 10 numbers
starting at 43) of /etc/security are copied into your /tmp directory
so that you can do arbitrary diffs between any version you like.
You can use tags instead of revision numbers if you like.
3) Instant upgrades. Since cvs always defaults to the head of the
trunk, you can do this:
2007-07-02 20:56:37 +04:00
# cp /p/netbsd/src/etc/security /etc/security
2001-11-16 13:25:42 +03:00
#
to upgrade to the latest and greatest version any time you like,
or you can do this:
# uname -r
1.5.2
2007-07-02 20:56:37 +04:00
# cp /p/netbsd/src/etc/security,netbsd-1-5-PATCH002 /etc/security
2001-11-16 13:25:42 +03:00
#
to get rid of any changes you might have made to /etc/security that
you no longer want.
Note that there's some support for the OpenBSD anoncvs.
You might also choose to use different servers entirely.