Setting up CVS/AFS for class submissions

I've started using a CVS repository on AFS for class submissions. It introduces students to revision control and encourages them to use it, plus can be used with timed checkouts to handle several deadlines (on-time, late, etc.). As an extra bonus, unlike the UMBC or blackboard submission tools, it doesn't require anyone but the instructor (or TA) to set up.

The basic idea is to create a repository for the class that everyone can get to, with directories for each student and subdirectories for each project. The students can access the main repository directory, but through AFS permissions can only see and write their own subdirectory. Students would typically check out their subdirectory only for work, and can do CVS checkins one proejct at a time. TAs and the instructor can check out the full tree of all students, and with wildcards like */assn1, can do dated checkouts of specific assignments as of their due date.

I should probably stick all of this in a script or two, but in the mean time these are notes on what I did to set it up. The for loops assume sh or bash-like shell.

  1. Create AFS groups for students and TA(s)
    1. pts creategroup $USER:<class group>
    2. pts adduser -group $USER:<class group> -user <space-separated userIDs>
  2. Create and set permissions for main repository (in a publicly accessible directory)
    1. mkdir <repository>
    2. fs la <repository>
    3. Identify anything (like system:anyuser) that should not have permission to see who is in the class
    4. fs sa -dir <repository> -acl \
      system:anyuser none \
      $USER:<class group> read \
      <TA userIDp> write
  3. Create repository and turn off history logging (which will fail due to permissions anyway)
    1. cvs -d <repository-full path> init
    2. rm <repository>/CVSROOT/history
  4. Check out a copy
    1. mkdir <private copy-full path>
    2. cd <private copy-full path>
    3. cvs -d <repository-full path> co .
  5. Edit CVSROOT/cvswrappers to set binary file types (if desired)
  6. Create template directory (I like to use my own userID)
    1. mkdir $USER{,/assn1[,...]}
    2. touch $USER{,/assn1[,...]}/.cvsignore
    3. find $USER -exec cvs add '{}' +
    4. cvs ci
  7. Copy template to rest of students and restrict access
    1. cd <repository-full path>
    2. for i in `pts membership $USER:<class group> | tail -n +2`; do \
      cp -r $USER $i; \
      find $i -type d -exec fs sa -acl $i write $USER:<class group> none -dir '{}' +;
    3. check permissions with fs la — user, TA and instructor should have write (rlidwk), class group should not be listed.
  8. Adding a new student
    1. cd <repository-full path>
    2. pts adduser -user <userID> -group $USER:<class group>
    3. cp -r $USER <userID>
    4. find <userID> -type d -exec fs sa -acl <userID> write $USER:<class group> none -dir '{}' +