On Friday, April 14, 2000 8:10 AM, William K. Gibson 
[SMTP:[EMAIL PROTECTED]] wrote:
>
> I need to know the best way to create links in CVS repositories.
>
> Specifically, can I construct links such that a module can be linked 
within
> another module and be checked out as a subdirectory.
>
> Here is an example of my situation. Say I have two modules, A and B. Both
> modules reside in their own seperate repositories in the CVSROOT. I have
> another module C containing a subdirectory C'. Within C' is source code 
that
> I wish to share amongst A and B. Can I simply create a link to C' in A 
and B
> and expect C' to be checked out as a subdirectory of A or B?
>
> If so, where do I create the link? Do I checkout A, and create a link to
> $CVSROOT/C/C' then add and commit the link? Will this work? Am I off my 
nut
> for wanting to do this?
>
We use the '&' module feature to do this type of thing, along with the -d 
option in the modules file.

If you do something like
_moduleA        -d srcA ModuleA
_moduleB        -d srcB ModuleB
_moduleC        -d srcC ModuleC

moduleA -d moduleA      &_moduleC &_moduleA
moduleB -d moduleB      &_moduleC &_moduleB

a cvs co moduleA will give a directory structure
moduleA/srcA
moduleA/srcC

a cvs co moduleB will give
moduleB/srcB
moduleB/srcC

You cannot checkout two modules into one directory, and you can't create an 
empty directory (e.g. srcC) and then checkout a & module that inserts a 
file into the directory, you need to do things the other way around.  If 
you had another line
_moduleAmake    makefiles/moduleA/makefile
you would have to make the moduleA definition
moduleA -d moduleA      &_moduleAmake &_moduleC &_moduleA
Any other order and the moduleA repository will be set as 'Emptydir' and it 
won't work correctly.

***************************************************************
Chris Cameron                    Open Telecommunications NZ Ltd
Software Development Team Leader
[EMAIL PROTECTED]                           P.O.Box 10-388
      +64 4 495 8403 (DDI)                          The Terrace
fax:  +64 4 495 8419                                 Wellington
cell: +64 21 650 680                                New Zealand
Life, don't talk to me about life ....(Marvin - HHGTTG)


Reply via email to