Subject: Re: Trouble cvs'ing security patch.
To: Ian Thomas <ipthomas@mac.com>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-users
Date: 10/12/2003 12:30:58
On Sun, 12 Oct 2003, Ian Thomas wrote:

> 	I'm running the following command to update my sources,
>
> cd /usr/src
> cvs update -P -rnetbsd-1-6 sys/kern/kern_sysctl.c
>
> 	I get the following error message in return
>
> cvs [server aborted]: no such directory `sys/kern'
> ssh: zathras.local: No address associated with hostname
> cvs [update aborted]: end of file from server (consult above messages
> if any)
>
> 	I'm leaving off the "-d" flag because I've set the $CVSROOT variable
> already.

Nonetheless, you should use "cvs update -Pd". That "-d" is different
than the "-d"  *before* "update". For general use, you can do

   echo update -P -d >> ~/.cvsrc

and never have to worry about specifying either "-P" or "-d". As a
matter of fact, for an update, ${CVSROOT} is unnecessary and unused,
as it's overruled by the contents of "CVS/Root". ${CVSROOT} is mainly
only useful for checkout and import.

> Without specifying a BRANCH, won't I get current sources?

No, you'll get the last tag or branch you pulled. When you want the
head, use "cvs update -A".

Not that it's relevant to the task at hand, but to help explain the
result you saw, know that if you're trying to pull a single file from
a subdirectory that doesn't exist in your checkout (from the head to a
branch checkout, say), even the "-d"  option to "update" won't help
you. Rather, you have to create the "empty" directories one level at a
time. For example:

   cvs -f update -d foo
   cvs -f update -d foo/bar
   cvs -f update -jnetbsd-1-6 -jHEAD foo/bar/new_file.c

Assuming that you've set up the ~/.cvsrc as I've suggested, you need
the "-f" to prevent the the directory from being pruned immediately
after creation, and the "-j" is so that a later

  cvs update -rnetbsd-1-6 -Pd foo

won't simply wipe out "new_file.c". Without "-j", it would then be
set back to the branch, were it doesn't exist, and then "foo/bar" and
"foo" would be pruned.

Frederick