Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CSE306 Operating Systems Projects CVS/SSH tutorial.

Similar presentations


Presentation on theme: "1 CSE306 Operating Systems Projects CVS/SSH tutorial."— Presentation transcript:

1

2 1 CSE306 Operating Systems Projects CVS/SSH tutorial

3 2 What is CVS? Concurrent Versions System Version Control System Multi-developer environment

4 3 CVS Repository Developer 1 Developer 2 Developer 3 Developer 4

5 4 checkoutupdatecheckindevelopment Ideal development with CVS repository Developer A Developer B

6 5 Definitions-Repository The Repository is a directory tree containing the CVS administrative files and all the RCS files that constitute "imported" or "committed" work. Kept in a shared area, separate from the working areas of all developers.

7 6 Definitions-RCS An RCS file is a text file containing the source text and the revision history for all committed revisions of a source file. Stored separately from the working files, in a directory hierarchy, called the Repository. RCS is the "Revision Control System" that CVS uses to manage individual files. RCS file names normally end in ",v".

8 7 Definitions-Working file A working file is a disk file containing a checked-out copy of a source file that earlier had been placed under CVS. If the working file has been edited, the changes since the last committed revision are invisible to other users of CVS. A working directory is the place where you work and the place from which you "commit" files.

9 8 Definitions-Checkout “Checking out" is the act of using the "checkout" command to copy a particular revision from a set of RCS files into your working area. You normally execute "checkout" only once per working directory (or tree of working directories), maintaining them thereafter with the "update" command.

10 9 Definitions-Revision A "revision" is a version of a file that was "committed" ("checked in", in RCS terms) some time in the past. Each version of a file has a unique revision number. Every file in a CVS repository can contain many versions, which are given revision numbers in form x.y[.x.y[...]]. ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 !

11 10 Definition-Tag-symbolic revision A release of a system will have many different revision numbers To let you find all the files in a release, use tags. Read Manual if you are interested

12 11 Definition-Branch Version number can contain more than two numbers to mark branches. Reasons to branch: fix bugs in product while working on next version work on subproject that will take a week to finish

13 12 Working on branches 1.11.21.3 release_1 cvs tag release_1 cvs up -r rel_1_fix 1.4 release_2 cvs tag release_2 1.2.2.11.2.2.2 patch rel_1_fix cvs tag -b rel_1_fix

14 13 checkin X Real development with CVS repository Developer A Developer B updateconflict resolution checkin conflict

15 14 CVS and the Development Cycle 1. Check out source files in working directory. 2. Edit source files. 3. Unit test your code. 4. Update working files to merge in changes from other developers (if necessary).

16 15 CVS and the Development Cycle 5. Test again if the sources were merged on step 4. 6. Commit changes. 7. Repeat from step 2 until you have a new release. 8. Tag the release. 9. Submit the module name and release tag for integration build.

17 16 Useful CVS commands cvs [cvs-options] command [cmd- options] [files] cvs checkoutCheck out source for editing. cvs commitcheck files into the repository (check in cvs addAdd new file/directory to repository. cvs removeRemove an entry from the repository. cvs updateBring working files into sync with repository.

18 17 Useful CVS Commands(con.) cvs diffCompare working files to version in repository or versions inside the repository. cvs logShow revision history for files. cvs statusShow status of checked out files. cvs tagLabel the sources.

19 18 Notes When to commit: Commit to mark a working state that you might want to return to later. For more information on CVS, please see www.cvshome.org www.loria.fr/~molli/cvs-index.html www.refcards.com/about/cvs.html

20 19 Starting the Project with CVS/SSH

21 20 Let us check your project To enable us to check the log, you must do this: cd ~ chmod 711. mkdir ~/.ssh2 chmod 700 ~/.ssh2 cp ~cse306/id_kifer.pub ~/.ssh2/ cp ~cse306/id_cse306.pub ~/.ssh2/

22 21 Let us check your project(con.) Create a file called ~/.ssh2/authorization Add the following lines there: Key id_kifer.pub Key id_cse306.pub Ensure proper access for both partners: chgrp -R your-group your-cvs-repository-directory chmod -R 770 your-cvs-repository-directory chmod -R g+s your-cvs-repository-directory

23 22 Start working with CVS Create empty repository cvs -d ~/CVSROOT init protect yourself from copycats! chmod -R 770 ~/CVSROOT

24 23 Working with partner if you are working with a partner and are assigned to the same user group, say c306- 00 then also type the following two commands: chgrp -R c306-00 ~/CVSROOT make sure new directories are created with the right permissions: chmod -R g+s ~/CVSROOT

25 24 Create directory structure for your repository your OSP project dir mkdir ~/your-project-dir/OSP your project dir for Proj 1 mkdir ~/your-project-dir/OSP/memory your project dir for Proj 2 mkdir ~/your-project-dir/OSP/threads your project dir for Proj 3 mkdir ~/your-project-dir/OSP/devices

26 25 Import directory structure cd ~/your-project-dir/OSP Import directory structure of your OSP project into your CVS repository cvs -d ~/CVSROOT import -m "Created OSP directory structure" OSP osp start In the above, `osp' and `start' are called "vendor" and "release" tags and can be anything. CVS requires them for import, but you can forget about them from now on.

27 26 Remove it Set the appropriate permissions for the OSP module in the cvs repository. Read/write for you and partner -- nobody else chmod 770 ~/CVSROOT/OSP Remove the OSP dir structure you just created cd ~/your-project-dir BE CAREFUL HERE!!!!!! rm -r OSP

28 27 Check Out Checkout OSP from the repository (this lets OSP create the necessary structures) cvs -d ~/CVSROOT checkout OSP Protect yourself! chmod 700 OSP

29 28 Partner Your partner should also checkout the same thing, but, of course, use ~your_account_id instead of just ~. Let's suppose you are 'john': Your partner does: cd ~/your-partner's-project-dir cvs -d ~john/CVSROOT checkout OSP chmod 700 OSP

30 29 Add new files Adding files (such as memory.c) to your repository using the command 'cvs add‘ Use `cvs add filename' to tell CVS that you want to version control the file. Command: cvs add [ -k kflag] [ -m message] files The `-m' option specifies a description for the file. This description appears in the history log

31 30 Commit Use `cvs commit filename' to actually check in the file into the repository. Other developers cannot see the file until you perform this step.

32 31 Which editor should I use? XEmacs (suggested) Nice interface to CVS, called pcl-cvs. Most of the CVS commands are available through the Tools/PCL_CVS menu of XEmacs. Put this line in your ~/.emacs file. (require 'pcl-cvs) After you invoke `cvs update', you get a CVS buffer, where you can invoke even more commands through the top-level menu called CVS

33 32 Where should I work? Undergraduate Computing Lab Remote access to UG lab by SSH (no GUI) Working at home with Linux/FreeBSD Working at home with MS Windows using WinCVS

34 33 Upgraded UG Lab Request a UG account at www.ug.cs.sunysb.edu Apply an access card from the undergrad secretary Read www.ug.cs.sunysb.edu to begin workingwww.ug.cs.sunysb.edu

35 34 Using SSH (Secure Shell) Remote access to UG lab by SSH only! Download a copy for your computer from www.ssh.com/download softweb.cc.sunysb.edu Type “man ssh” for more information

36 35 Working at home with Linux/FreeBSD Set the environment variable CVS_RSH to ssh You can checkout a copy directly to your home computer as follows (assuming that you are 'mary' in the UG lab): cvs –d :ext:mary@public.ug.cs.sunysb.edu:your_homedir /CVSROOT checkout OSP Note: your_homedir must be the full path name to your home directory at public.ug.cs.sunysb.edu

37 36 WinCVS on your desktop Download a copy from www.wincvs.org www.cvsgui.org Set up with SSH step by step http://www.cvsgui.org/ssh.html

38 37 WinCVS: Configuration Your UNIX login

39 38 WinCvs: Main screen file view status view modules state icon revision numberfile typebranch name

40 39 Checking out the sources

41 40 Source history & diff

42 41 Commit, Update & Tag update commit tag


Download ppt "1 CSE306 Operating Systems Projects CVS/SSH tutorial."

Similar presentations


Ads by Google