# Presentation: 118350

## Configuring Sourceforge’s CVS to work with Forte (3.0 or later) on WindowsNT and Windows 2000

- Specific for MAExplorer.sourceforge.net
- Written by Eric Shen, U. Arizona, July, 2002
- Revised: P. Lemkin, Sept, 2002

## Introduction

**CVS book**: Open Source Development with CVS by Moshe Bar, Karl Fogel, Paraglyph Publishing; ISBN: 1932111204; 2nd edition (July, 2002)
**CVS home page**: http://www.cvshome.org/
**Forte home page**: http://java.sun.com/j2se/1.4/relnotes-cobundle.html
**SourceForge.net CVS documentation: **click on ”Site Docs”,
-      then scroll to
-        5. Information for SourceForge.net Project Developers
-      and
-        6. CVS Instructions
**Forte 4.0 book**: _Sun One Studio Programming_ by Rashim Mogha, Ruchi Bhargava, John Wiley & Sons; ISBN: 0764549456; (July, 2002).  [Forte 4.0 is now called “Sun One”]

## 1. Download and install the necessary programs

- PuTTy
- http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- Scroll down and download:
- putty.exe		(ssh client)
- plink.exe		(command line client)
- pageant.exe	(authentication agent for public / private key authorization)
- puttygen.exe	(utility for generating RSA public / private key pairs)
- Put these files into C:\putty
- WinCVS
- http://sourceforge.net/project/showfiles.php?group_id=10072&release_id=24467
- Scroll down to the WinCvs group
- Download WinCvs13b8.zip or higher
- Unzip into temporary folder
- Run setup and install WinCVS into directory C:\putty\WinCVS

## 2. Setting the environment variables

- Find your system’s environment variables:
- WinNT
- Right-click “My Computer”, select properties, select “Environment” tab
- Windows 2000
- Right-click “My Computer”, select properties, select the “Advanced” tab, click on “Environment Variables”
- Add these new variables:

- Note: If the variable PATH already exists, you can append to it by adding a
- “;” (semi-colon) first

## 3. Generating a new public / private key pair

- Go into the C:\putty directory and startup the puttygen.exe program
- Select “Type of key to generate” as SSH1 (RSA)
- Type in “Number of bits in a generated key” as 1024

## 4. Generating a new public / private key pair (cont.)

- Click on Generate
- Move the mouse randomly in the center area to generate the key

## 5. Generating a new public / private key pair (cont.)

- After key is generated, type in the “Key comment” field:
*username*@users.sourceforge.net
- This is the username that you registered with Sourceforge.net
- Type in a passphrase for the key
- Note: This passphrase should be different than your Sourceforge.net login password

## 6. Generating a new public / private key pair (cont.)

- Click on “Save public key”
- Save your public key in C:\putty (or wherever else you like)
- Name it something like “SOURCEFORGE.NET.KEY”
- Click on Save
- Click on “Save private key”
- save your private key in C:\putty (or wherever else you like)
- Name it something like “sourceforge.net.privkey
- Click on Save
- Keep puttygen open for the next step

## 7. Uploading your public key to Sourceforge

- Go to: http://sourceforge.net
- Login to Sourceforge using your Sourceforge username and password
- Click on “Account Options”

- Scroll down to the bottom of the page and select “Edit Keys”

## 8. Uploading your public key to Sourceforge (cont.)

- Go to the putty key generator and select the entire key from the box
- Press Ctrl+c to copy the key into the clipboard

## 9. Uploading your public key to Sourceforge (cont.)

- Go to the Sourceforge page and paste the key into the box

- Click “Update”

## 10. Uploading your public key to Sourceforge (cont.)

- The number of Authorized Keys should now say “1”

- Click “Update”
- Now you must wait 6 hours for Sourceforge to upload your key into their system (security issue...)
- You can check to see if Sourceforge has uploaded your key by using an ssh client (such as putty.exe) to login to shell.sourceforge.net
- cd into the “.ssh” directory
- look in the file “authorized_keys2”
- compare this with the public key file you created
- if your public key has been written into this file, then Sourceforge has uploaded it
- NOTE: manually copying your key into this file WILL NOT WORK

## 11. Creating your initial user directory

- Go into the C:\putty directory and run putty.exe
- Set Host Name to cvs.sourceforge.net
- Set port to 22
- Set Protocol to SSH
- Name the session for future use and select Save
- Open the session
- When the connection is opened, verify the host key that is returned
- The correct key is listed at: http://sourceforge.net/docman/display_doc.php?docid=3088&group_id=1#top
- If the key is correct, click “yes”
- After entering your login and password, the system will create your home directory, and then log you out

## 12. Setting up the authentication agent

- Start up pageant.exe in the C:\putty directory
- The pageant icon should appear in your system tray

- Double-click on the pageant icon
- Click on “Add Key” and select your private key to add
- Pageant will give an error if you try to load the public key instead
- Enter your passphrase for that key
- The key should now show up in the Pageant Key List

## 13. Testing the authentication agent

- Make sure that pageant is running in your system tray and that your private key is loaded correctly
- Go to the command prompt and type:
- plink *username*@shell.sourceforge.net echo “testing”
- If the word “testing” comes back without prompting for a password, then the authentication agent is working
- NOTE: This step must work for later actions to complete successfully
- If it prompts for a password, then check to make sure that:
- pageant is up and running
- your private key is loaded into pageant correctly
- the private key loaded into pageant was generated with the public key uploaded to sourceforge
- the public key was submitted using the web-page interface (see slides 8 - 11)
- the public key is stored correctly (see slide 11)

## 14. Doing an initial checkout through Forte

- Make a directory to store your cvs files, such as C:\cvs
- Open up Forte
- Right click on “Filesystems” in the explorer window and select:
- Mount  ->  Version Control  ->  CVS

- Put the directory you created as the Working Directory
- Click Next

## 15. Doing an initial checkout through Forte (cont.)

- Select Connection Method as “External”
- Set CVS_RSH=plink
- Server Name is cvs.maexplorer.sourceforge.net
- Enter your Sourceforge.net user name
- Repository is /cvsroot/maexplorer
- Click Next

## 16. Doing an initial checkout through Forte (cont.)

- Select “Use CVS Command-Line Client Support
- Set the CVS executable to the cvs.exe that is in the WinCVS install directory

- Click Next

## 17. Doing an initial checkout through Forte (cont.)

- Check the box that says “Initial Checkout”

- Click Finish

## 18. Doing an initial checkout through Forte (cont.)

- A CVS Checkout box will appear
- Type in the Module to download as “maexplorer”
- This will download the core files for MicroArray Explorer
- NOTE: the “Select...” button does not work, as the SELECTOR_MODULES command from within Forte does not work with Sourceforge
- A full list of modules that can be downloaded can be found here:
- http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/maexplorer/
- If you would like to download all the modules at once, type in a “.” (period) in the Modules textbox
- Click OK

## 19. Working with CVS through Forte

- If files are up to date, it will be listed as such in the Explorer window, along with the version number

- When code is edited so that it differs from the code that was checked out using CVS, the Explorer window will reflect this change

- To execute CVS commands, right click on a single file, multiple files, an entire directory, or the entire CVS repository, and select CVS 

## 20. Working with CVS through Forte (cont.)

- Useful CVS commands:
- Refresh
- refreshes the _status_ of the files from the CVS server (in case changes to files have been made and committed)
- Refresh recursively
- same as refresh, but recursively traverses through subdirectories
- Commit
- submit your code changes to the CVS repository
- Update
- gets the latest version of the file(s) from the CVS repository and merges those changes with the local version
- Add
- adds files to the CVS repository, if it does not exist already
- after doing this, a commit must be performed for the changes to be recorded
- Remove
- removes the local version of the file
- after doing this, a commit must be performed to remove the file from the CVS repository as well
- Release
- undoes a checkout and deletes all checked-out files and directories

## 21. Working with CVS through Forte (cont.)

- Status
- gets status of the file in relation to the CVS repository
- Log
- displays the CVS log file, which is a record of all changes and their comments
- Annotate
- displays a second window which shows all the lines of code and who added it, the date it was added, and which version number it was submitted under
- Check Out
- checks out a CVS module (file or directory) from the repository
- Edit Options
- these options are useful if more than one person is working on the same file
- Editing  Edit
- lets other programmers know that you are editing the file
- Editing  Undo Edit
- reverts the file back to the CVS repository’s version
- Editing  Editors
- gets a list of people who have registered as editors of this file
- Locking  Lock
- locks this file so that no one else may edit it
- Locking  Unlock
- unlocks this file so that others may edit it

## 22. Working with CVS through Forte (cont.)

- Branching and Tagging  Merge
- merges any two files together
- you should only do this after doing a diff to confirm that the two files have exclusive changes in their code
- Diff Graphical
- Displays a side-by-side view of the current local version of the code with the most recent code in the CVS repository.  These windows are synchronized scrollable windows and visually highlight changes to as well as additions / removals of code.  This is very handy for finding out at a glance whether code can be safely merged together.
- Diff Textual
- displays a text summary of the differences between a local version of a file and the one stored in the CVS repository

## 23. Working with CVS through Forte examples

- How to submit a change
- Things to check for
- “diff” the file with the latest versions in the CVS repository, to make sure that no one else has submitted changes to your code
- make sure that your code compiles
- change all version numbers and dates hard-coded into your file, if any exist
- Right click on the file and select CVS  Commit
- NOTE: you can also commit an entire directory or local CVS repository.  This action will only commit to the online repository those files which have been “Locally Modified”

## 24. Working with CVS through Forte examples (cont.)

- A text box will appear, allowing you to comment on what changes have been made in the version you are about to submit

- Click OK to commit the changes

## 25. Working with CVS through Forte examples (cont.)

- The updated version of the code is now reflected in the Explorer window, along with the new version number

- You can also check the online repository to see these changes
- go to http://maexplorer.sourceforge.net
- click on CVS Repository
- find the file(s) that you committed

- By clicking on the file, you can get an in depth view of the revision history of the file, including the actual code and changes in the code between any past revisions

## 26. Working with CVS through Forte examples (cont.)

- To remove a file from the CVS repository
- remove the local version of the file

- The file will indicate that it has been locally removed, although it still exists in the online CVS repository

## 27. Working with CVS through Forte examples (cont.)

- To remove the file from the online repository as well, do a commit on the removed file

- File is now removed, but a copy is still saved so that it can be retrieved later (in the “Attic directory”)

## 28. Working with CVS through Forte examples (cont.)

- To revert a file back to a previous version
- Remove the local file

- Right click on the directory that contained the local file and select CVS  Check Out

## 29. Working with CVS through Forte examples (cont.)

- Append a “/” (slash) in front of the directory name and type in the file you with to checkout
- Indicate the old revision you wish to revert to
- Click OK

- The old revision of the file now shows up in the Explorer window
- The (1.2) indicates that this file is an old revision

## 30. Working with CVS through Forte examples (cont.)

- To make this file the latest revision in the CVS repository, commit it along with a description regarding what changes have been made

## 40. Resources

- CVS info from Sourceforge.net
- http://sourceforge.net/docman/?group_id=1
- Scroll down to “6.  CVS Instructions”
- _Open Source Development with CVS_ by Karl Fogel
- Questions or comments, please email
- mae@ncifcrf.gov for MicroArray Explorer specific questions
- eshen81@hotmail.com for queries specific to this document