10.12 Importing The Package Into CVS

The final step in creating the package is to make it available to the other developers. You do so by importing it to the version management system. Before you can do so, you should consult your project's policies on who can do this and how it should be done. At the very least you should contact the package coordinator for the package under which you plan to import yours. If you plan to make the package a top-level package, contact the software librarian.

Once you have received an approval to import your package, make sure you have cleaned it up. Root out everything that is unrelated to your package, and clean up the source tree into the form in which you wish to have it storead in CVS. It is advisable to spend some effort on this since structural changes such as renaming files or directories is a bit clumsy to do within CVS. If you have followed the advise so far, the structure of your package should be satisfactory, but you should still make sure the files are called what you want them to be called in the long term. When finished with the cleanup, make sure that README and NEWS (and possibly ChangeLog) files are up to date--you should never release a package with these files missing or outdated. Then issue commands such as these:
$ cd ~/public/work/EM_Event
$ make distclean
$ srt version EM_Event-00-00-00
$ cvs import -m offline/LArCalorimeter/EM/EM_Event: imported' \
   offline/LArCalorimeter/EM/EM_Event PROJECT EM_Event-00-00-00

The last command imports the package into CVS into the directory named by the argument after the -m option. Pay attention to which directory you are at the time of issuing this command: import will just start from the current directory and recursively put everything it can find into CVS. Moreover, you should use the vendor tag customary to your software project where the command above used PROJECT (your software librarian should be able to tell you which tag to use). The version number you give as the last argument need not be all zeroes: if this is not the first version of your package but you are simply converting it into SRT, you can just continue from where the package was earlier on.

Finally, check that everything went smoothly by checking the sources out from CVS and trying to rebuild your package; for instructions, see Section 8.1, ``Recompiling One Package''. When you are sure that the package stored in the CVS works correctly, nuke the directory from which you imported the package into CVS. Then check the package out from CVS and work with that copy--you should never keep working with the copy you imported in CVS. For that matter, you should never import the same package twice into CVS.[1]

Notes

[1]

As a matter of the fact it is possible to import a directory several times into CVS, with pretty much the right results. However, you should restrict the use of that feature only to importing sources from external sources, never with sources you maintain and modify yourself. Checking out sources from CVS and then re-importing them again is an extremely bad idea.