Subject: Re: CVS
To: Richard Ibbotson <richard@sheflug.co.uk>
From: Robert Elz <kre@munnari.OZ.AU>
List: netbsd-help
Date: 10/20/2003 17:10:39
    Date:        Mon, 20 Oct 2003 10:58:07 +0100 (BST)
    From:        Richard Ibbotson <richard@sheflug.co.uk>
    Message-ID:  <Pine.LNX.4.58.0310201046270.13321@sheflug.sheflug.net>

  | I'd like to update kernel sources on my 1.6.1 box using anonymous CVS.

Do you want to update to NetBSD -current (the bleeding edge, not even
guaranteed to compile version - though just at the minute it seems OK)
or to the latest version of NetBSD 1.6 (what will eventually become
1.6.2) ?

  | When I update from CVS do I 'cd' to somewhere on my own system before 
  | I get started ?

Usually to /usr/src or wherever you have the sources.   Assuming that
you want to truly "update" - otherwise cd to a directory into which you
can make a new src directory (like /usr perhaps if you have no /usr/src)
if you want to fetch a whole new set of sources.

In the former case (you are going to just update), check the CVS/Root
file to make sure it contains something that looks reasonable 
(anoncvs.netbsd.org or similar should be in there somewhere).

If not, ask for more help...

If you are going to do an update, look for a CVS/Tag file, which, if
it exists, will keep you on the netbsd-1-6 branch - if not, an update
with no extra args will take you to NetBSD -current.

If everything looks OK, then...

  | Other one is... the docs say something about 
  | exporting something to somewhere in order to use CVS.  No clue what 
  | that means.

It means "set an environment variable".

If your shell is sh (or ksh, bash, zsh, ...) that's done by

	export CVS_RSH=ssh

If your shell is csh (or tcsh) it is done by

	setenv CVS_RSH ssh

(notice no '=').   (But change shells...)

  | So, after I export something I then do an update command.  
  | Would this be something like 'checkout CVS' or something ?

To fetch everything, making a new "src" directory, it would be

	cvs checkout -P src

(which will fetch NetBSD -current).   If you just want to update
existing sources, and you're already in the src directory, and that
contains a CVS directory with sensible contents, then instead to

	cvs update -dP

(in either case, you might prefer cvs -q ... to get rid of some of
cvs's noisy output).

If you want to get the netbsd-1-6 branch, and you're not doing an
update with a CVS/Tag file already existing with the right content,
you need to add

	-r netbsd-1-6

to the args of checkout or update (eg: cvs -q checkout -P -r netbsd-1-6 src)

  | I know that there is a .cvs file somewhere which might have 
  | configuration options but can't find that.

If you want that, you need to create it yourself in your home
directory.   It isn't needed though.   You can use it to set
default options to cvs commands (like that -q to cvs, or the -dP
to update) so you don't have to remember them every time.

kre

ps: if you have the space, and don't mind several hundreds of MBs
of data transfer, and hours of waiting, doing it the checkout way
is safer - if something doesn't work, you just delete the src
directory created (in your home directory somewhere if you like)
and start all over again - no harm done.