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