13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

194Chapter 8Know What You Have: CVSused, though, to set up the project. Once a project is established, the informati<strong>on</strong>in CVSROOT is kept, al<strong>on</strong>g with other data, in a directory of files (calledCVS). From that point <strong>on</strong>, CVSROOT (the envir<strong>on</strong>ment variable) no l<strong>on</strong>ger needsto be set. The CVS commands will always use what is in the local sandbox todetermine where the repository is; the value of the envir<strong>on</strong>ment variable willbe ignored.It is possible to have different repositories for different projects. Onerepository might be for your pers<strong>on</strong>al work—revisi<strong>on</strong>s of memos and documentsthat you create <strong>on</strong> your local machine and store in a repository also <strong>on</strong>your local machine. Another repository might be a shared network-basedrepository, used for a project at work. Still another might be a network-basedproject for some Open Source work that you do in your spare time. Since theCVS repository keeps track of whence it comes, you needn’t set a value forCVSROOT every time you switch projects. Instead, CVS knows from within thesandbox where to go for its updates, commits, and so <strong>on</strong>.So let’s get started and create a CVS repository <strong>on</strong> our local <strong>Linux</strong> system,in our own home directory. We will call the repository srcbank, as it will bethe “bank” where we will deposit our source files.$ mkdir ${HOME}/srcbank$ export CVSROOOT="${HOME}/srcbank"$ cvs initThe mkdir creates the directory named srcbank as a subdirectory of ourhome directory. The export command sets the shell variable CVSROOT to referto the locati<strong>on</strong> of the new directory. The cvs init command initializes therepository with some needed directories and data files.Before the cvs init command, the srcbank directory is empty. Afterwardit c<strong>on</strong>tains a directory called CVSROOT (literal name, not the shell variable’svalue) which c<strong>on</strong>tains a variety of administrative files—most of which you neednever worry about.If your are using a remote repository, that is, <strong>on</strong>e that you c<strong>on</strong>nect to overa network (typical when you are sharing a repository am<strong>on</strong>gst team members),then you need <strong>on</strong>e additi<strong>on</strong>al step—you need to log in to the CVS repository’sserver:$ cvs login

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!