CSE 490c/303 Homework 7 Milestone 1

Target Date: Wednesday, 12/3
Turnin: Nothing

This is a piece of Homework 7. If you haven't come here by first reading that, this page won't make much sense.

Milestone 1 - Target Date: 12/3

You should have received mail indicating who your team members are, what the name of the Unix group you'll be using is, and where your project space is. If you did not, let me know ASAP.

A. Contact Your Team

Get in touch with your team and try to set up a schedule where you can all get together. If you intend to work mostly independently (on separate pieces, say), which I do not recommend for this project, then ideally, you'll be able to find at least 20 minutes each weekday up to the final due date. You can use that time just to exchange status reports and perhaps solutions to problems.

I think a better approach to working as a team (for this assignment) would be to try to find a couple hours when you could get together to try to complete a milestone, as a team. This would be most effective if each of you had done some reading about the milestone's topic beforehand.

B. cvs - Set Up Your Working Directory
You will have to do this only once (now). Once the working directory is set up, dealing with cvs gets a lot easier.

On the machine where you would like to work, cd to the directory that you want to be the parent of your working directory. The working directory will be called hw7.

Now do one of the following:

  • If the file path /projects/instr/03au/cse490c/cse490c-X is accessible, where 'X' is your group letter ('a' through 'p'), then
    $> cvs -d /projects/instr/03au/cse490c/cse490c-X/CVSRepository checkout hw7
    
    Make sure to substitute for the 'X' in the above.
  • Otherwise
    $> cvs -d :ext:yourlogin@attu.cs.washington.edu:/projects/instr/03au/cse490c/cse490c-X/CVSRepository checkout hw7
    
    Make sure to substitute your own login name for 'yourlogin' above, and to subsitute your group letter for 'X'.

    IF that command fails, then

    $> export CVS_RSH="ssh"
    
    You need that environment variable set every session, so you might as well put it in your .profile. (I think the default cygwin install arranges for it to be set, so the command above will most likely just work the first time you try it.)
Either way, a directory hw7 should appear, containing subdirectories itself.
C. Test Installing/Executing .cgi's
Prepare your account on abstract.cs.washington.edu:
  • ssh abstract.cs.washington.edu
  • If you don't already have one, mkdir www
  • chmod a+x www
  • cd www
  • mkdir cse490c
  • chmod a+rx cse490c
  • logoff abstract (returning to the machine containing your working directory)
Push some .cgi's to your abstract web space:
  • cd into hw7/ExampleCGIs
  • make. You'll have to supply your (Unix) password, as the Makefile will try to copy the example .cgi's in the directory you're in to the direcory you just created on abstract.
See if it worked:
  • Bring up Mozilla
  • Set its dial to http://abstract.cs.washington.edu/~yourlogin/cse490c/env.cgi (once again substituting for 'yourlogin').
  • You should see a page full of stuff -- the environment variable values available to the .cgi you just ran.
  • Now try http://abstract.cs.washington.edu/~yourlogin/cse490c/form.cgi. The form it should show is operational -- change some values and hit the submit button.
D. Regular use cvs commands
Once you've created your working directory from the cvs repository, you'll most likely need to use only the following commands:
cvs add filename Schedules a file to be added to the repository. The file is not actually copied to the repository until you execute a commit, unless the file is a directory (in which case a directory with that name is created in the repository, but the directory contents are not).
cvs remove filename Schedules the "deletion" of a file from the repository. (A) You must first delete the file from the current working directory. (B) The file is not actually deleted -- it's moved to a directory in the repository named Attic. (C) Removal doesn't occur until you do a commit.
cvs commit Updates the CVS repository, operating recursively from the current directory (i.e., includes all subdirectories). (A) Actually completes any add's or remove's previously executed. (B) Writes to the repository any files that (a) are included in the repostiory, and (b) have been changed since they were last fetched from the repository.
cvs update Starting with the current directory and operating recursively into subdirectories, updates all files (on the local machine) that have newer copies in the repository. Also fetches files that are in the repository but for which no local copy exists, except that it will not fetch missing directories or their contents.
cvs update -d As above, except also fetches any directories (and their contents) that are in the repository but for which no local copy exists.
The following just gives you some experience with (some of) these commands:
  • cp formtest.cgi yourname-test.cgi
    You want to create a unique name for your copy, so that you don't get conflicts with other team members in the repository.
  • cvs add yourname-test.cgi
  • cvs commit
    An editor will appear, offering you the chance to append a message with the file to be checked in. I don't know how cvs decides what editor to use, but for me it's vi (or maybe vim). To add text: use the arrow keys to move to the end of the text that's there. Type a single 'a' character. Now type your content. When done with your content, hit the ESC key. Now type the two character string ":w" (which writes the file). Now type ":q".
  • Edit the file you created by adding this line:
        print "<p>yourname's form test\n";
    immediately before the comment
        # start the form
  • Type make to move your new .cgi (and all the old ones) to abstract.
  • Point Mozilla at your new .cgi. You should see the line you added near the top of the page.
  • cvs commit
  • rm yourname-test.cgi
  • cvs update
E. One Final cvs Note
Unlike rcs, cvs does not prevent multiple users from checking out and editing a single file. (In fact, the entire idea of locking a file to prevent other users from editing it is considered odd in the cvs world.)

This means that you need to be somewhat coordinated as a team. If multiple people edit a file and then commit it, cvs will try to merge all the independent updates in the repository's copy. (If it can't merge them, it will complain and make you merge them.) Most often, it's best to avoid this situation.