Software Systems Spring 2008 For today, you should have: 1) worked on your project 2) prepared for a quiz on I/O and database implementation. 3) written a semaphore problem 4) read about P2P systems Outline: 0) quiz 1) P2P 2) select 3) semaphore problems (work with your project team) 4) draft report feedback 5) course evals For next time you should: 1) finish your project 2) refine your semaphore problem and write it up 3) check hw06 into your repository 4) check the final version of your project report, in good PDF, into your repository, along with any supporting files. Subversion ---------- Subversion, abbreviated svn, is a suite of programs for managing repositories. A repository is an archive that keeps track of successive versions of electronic documents. A repository is often (but not necessarily) on a remote server. I have created a repository on svn.allendowney.com that contains a directory for each of you. Here is an overview of what you will do with it; details follow: 1) First, you will copy your repository from the server to your laptop. This is called "checking out" (by analogy with checking a book out of a library). The copy of the repository on your laptop is called a "local copy" or "working copy." 2) Next you will navigate into the newly-created directory and either modify existing files or add new files and directories. If you add a new file or directory, you have to tell svn about it. This operation is called an "add", but that name is a little misleading; it would be more precise to say, "notify svn about a new addition." 3) When you are ready to copy your changes and additions back to the repository, you "check in" (again, by analogy with a library). This operation is also called "commit", because by copying your changes back to the repository, you are making the changes permanent. But don't be afraid of committment; your repository keeps track of all prior versions, so if you commit a change and then regret it, you can always "revert" to a prior version. 4) On my hard drive, I keep a local copy of the whole repository (which contains all of your directories). When you finish a homework and check it in to your repository, I will "update" my local copy of your repository, which will cause your changes to be reflected in my local copy. Then I can read and execute your programs. Now here are the details about how you perform each of those operations: 0) In order to access your repository, you will need a username and password. Your username is the same as your Olin email address, without the @students.olin.edu part. So, for example, my username is allen.downey. Your password is... You also may need to install the subversion client (you don't need the server). On Ubuntu, run "sudo apt-get install subversion" On Fedora, run "yum install subversion" 1) To check out your repository, create a terminal and navigate to your home directory. Then type svn --username first.last co https://svn.allendowney.com/ss08/first.last All svn commands begin with "svn" followed by an operation and other arguments. In this case the operation is "co", which stands for "check out" and the argument is the URL of your repository. Of course, you should replace "first.last" with your name. You will be prompted for your password. Type your password and hit return. You should get a message like "Checked out revision 3." 2) If you type "ls" you should see a new directory with a name like "first.last". This is your local copy of the repository. Navigate into this directory and type "ls". There are currently no files in your directory. Use an editor to create a file named test.txt. To notify svn that this file should be considered part of the repository, run svn add test.txt You should get a message like "A test.txt". 3) To check in your changes (in this case the added file), type svn ci -m "Adding test file" You should get a series of messages telling you what svn is doing, ending with something like, "Committed revision 4." To confirm that the server has the new file, you can use a browser to view https://svn.allendowney.com/ss08/first.last You should see the new file there. 4) You don't do step 4. I do step 4. How to turn in Homework 6 ------------------------- 1) Navigate into the local copy of your repository. 2) Make a directory for Homework 6: svn mkdir hw06 By using svn to make the directory, you get two operations for the price of one: svn makes the new directory and "adds" it to the repository. 3) Copy file(s) into the new directory: cp ~/queue/* hw06 And then add each file to the repository: cd hw06 svn add queue.c svn add queue.h svn add main.c svn add Makefile Note: only source files should be added to the repository; no executables, no object (.o) files. 4) Check in the changes. svn ci -m "Adding hw06" If all goes well, I should be able to update my local copy of your repository, cd into your hw06 directory, run "make" and then run your executable. If you want more information about Subversion, there are several good guides online, including am excellent, and free, book at http://svnbook.red-bean.com/ And several tutorials at http://polishlinux.org/apps/subversion-howto/ http://www.linux.com/articles/45381 http://www.onlamp.com/pub/a/onlamp/2002/10/31/subversion.html