View
215
Download
0
Embed Size (px)
Citation preview
Working in Project Teams Using CVS and Solaris ACLs
● Concurrent Version System: Allows multiple programmers to work on one project
at the same time● Also allows programmers from different file systems
(requires server mode)
Keeps track of multiple versions of the same project● Solaris Access Control Lists:
Allows individual users to grant read, write, or execute access to their files by other individual users without requiring sysadmin (root) permission
Example
● Suppose the following users on the ub file system wish to form a project team: savvypac tcolburn gshute
● One user, the designated project leader, must: create a CVS repository, grant access to the repository by the other users import a project directory into the repository or create
one from scratch
Creating A CVS Repository
Suppose savvypac is the project leader:
ub 5% pwd/home/vole/19/savvypac
Create a directory for the repository:
ub 6% mkdir cvsroot
Make this directory's path the value of your CVSROOTenvironment variable:
ub 7% setenv CVSROOT /home/vole/19/savvypac/cvsroot
Setting Regular and Default ACLs for Repositories
First, give default read, write, and execute access to(as yet unspecified) users for every file and directorythat will be created in the repository in the future:
% setfacl -s m:rwx,u::rwx,g::---,o:---,d:m:rwx,d:u::rwx,d:g::---,d:o:\--- cvsroot
% getfacl cvsroot
# file: cvsroot# owner: savvypac# group: externaluser::rwxgroup::--- #effective:---mask:rwxother:---default:user::rwxdefault:group::---default:mask:rwxdefault:other:---
Notes On Default ACL Example
● This gives rwx access to user but not to group or other.● The -s option (set) requires that all 8 ACLs be set.● There can be no spaces in the comma-delimited list of permissions.● user and group require the double colon● The mask permission bits are anded to each permission to produce an effective permission
Specifying Privileged Users
First, give tcolburn and gshute access to the repository:% setfacl -m u:tcolburn:rwx,u:gshute:rwx cvsroot
Next, give tcolburn and gshute access to future filesand directories in the repository:
% setfacl -m d:u:tcolburn:rwx,d:u:gshute:rwx cvsroot
Note the use of the -m (modify) option instead of -s.
Reality Check% getfacl cvsroot
# file: cvsroot# owner: savvypac# group: externaluser::rwxuser:tcolburn:rwx #effective:rwxuser:gshute:rwx #effective:rwxgroup::--- #effective:---mask:rwxother:---default:user::rwxdefault:user:tcolburn:rwxdefault:user:gshute:rwxdefault:group::---default:mask:rwxdefault:other:---
% ls -ld cvsrootdrwx------+ 2 savvypac ... Apr 16 20:30 cvsroot/
Using the cvs Command
ub 8% cvsUsage: cvs [cvs-options] command [command-options-and-arguments]
where cvs-options are -q, -n, etc. (specify --help-options for a list of options)
where command is add, admin, etc. (specify --help-commands for a list of commands or --help-synonyms for a list of command synonyms)
where command-options-and-arguments depend on the specific command (specify -H followed by a command name for command-specific help)
Specify --help to receive this message
Using the cvs Command (cont'd)ub 9% cvs --help-optionsCVS global options (specified before the command name) are: -H Displays usage information for command. -Q Cause CVS to be really quiet. -q Cause CVS to be somewhat quiet. -r Make checked-out files read-only. -w Make checked-out files read-write (default). -l Turn history logging off. -n Do not execute anything that will change the disk. -t Show trace of program execution -- try with -n. -v CVS version and copyright. -T tmpdir Use 'tmpdir' for temporary files. -e editor Use 'editor' for editing log information. -d CVS_root Overrides $CVSROOT as the root of the CVS tree. -f Do not use the ~/.cvsrc file. -z # Use compression level '#' for net traffic. -a Authenticate all net traffic. -s VAR=VAL Set CVS user variable.(Specify the --help option for a list of other help options)
Using the cvs Command (cont'd)ub 10% cvs --help-commands add Add a new file/directory to the repository admin Administration front end for rcs annotate Show last revision where each line was modified checkout Checkout sources for editing commit Check files into the repository diff Show differences between revisions edit Get ready to edit a watched file editors See who is editing a watched file export Export sources from CVS, similar to checkout history Show repository access history import Import sources into CVS, using vendor branches init Create a CVS repository if it doesn't exist log Print out history information for files login Prompt for password for authenticating server logout Removes entry in .cvspass for remote repository pserver Password server mode rdiff Create 'patch' format diffs between releases release Indicate that a Module is no longer in use remove Remove an entry from the repository rtag Add a symbolic tag to a module server Server mode status Display status information on checked out files tag Add a symbolic tag to checked out version of files unedit Undo an edit command update Bring work tree in sync with repository watch Set watches watchers See who is watching a file
Initializing a New CVS Repository
ub 12% cvs init
ub 13% cd cvsroot
ub 14% lsCVSROOT/
ub 15% cd CVSROOT
ub 16% lsEmptydir/ cvswrappers modules taginfo,vcheckoutlist cvswrappers,v modules,v val-tagscheckoutlist,v editinfo notify verifymsgcommitinfo editinfo,v notify,v verifymsg,vcommitinfo,v history rcsinfoconfig loginfo rcsinfo,vconfig,v loginfo,v taginfo
Importing a Project Directory Into a Repository
Suppose savvypac has the following directory structure:
savvypac
cvsroot project
CVSROOT subdirprojectfile1
projectfile2 projectfile3
Importing a Project Directory Into a Repository (cont'd)
% cd project% cvs import -m "Imported directory" teamproject\ignore1 ignore2N teamproject/projectfile1N teamproject/projectfile2cvs import: Importing .../cvsroot/teamproject/subdirN teamproject/subdir/projectfile3
No conflicts created by this import
This imports the project directory into the repositoryas teamproject. Note the -m <msg_string> option and the last two (ignored in this case) arguments.
% cd ../cvsroot% lsCVSROOT/ teamproject/
New Directory Structure
savvypac
cvsroot project
CVSROOT teamproject
subdirprojectfile1,v
projectfile2,v projectfile3,v
Checking Out A Directory From A Repository
Suppose tcolburn has the following directory structure:
tcolburn
work
Now tcolburn wants to check out the teamprojectdirectory from the repository into his (currently empty)work directory.
Checking Out A Directory From A Repository (cont'd)
% whoamitcolburn
% setenv CVSROOT ~savvypac/cvsroot
% cd work
% ls // empty directory
% cvs checkout teamprojectcvs checkout: Updating teamprojectU teamproject/projectfile1U teamproject/projectfile2cvs checkout: Updating teamproject/subdirU teamproject/subdir/projectfile3
% lsteamproject
tcolburn's Directory Structure After Checkout
tcolburn
work
teamproject
subdirprojectfile1
projectfile2 projectfile3
CVS
The CVS Directory
● After checkout, tcolburn can work on any of the teamproject files except those in the CVS subdirectory
● Note that every directory in the structure has a CVS subdirectory
● CVS subdirectories hold information about directory entries and repository location
Checking In Changes
Suppose tcolburn makes changes to projectfile3.He checks the file back in to the repository usingthe commit command:
% cvs commit -m "Log message" projectfile3Checking in projectfile3;/home/vole/19/savvypac/.../projectfile3,v <-- projectfile3new revision: 1.2; previous revision: 1.1done
/home/vole/19/savvypac/cvsroot/teamproject/subdir:total 6drwx------+ 2 savvypac external 512 Apr 16 23:34 .drwx------+ 3 savvypac external 512 Apr 16 22:55 ..-r--r--r--+ 1 tcolburn cs 506 Apr 16 23:34 projectfile3,v
Note that tcolburn is the new owner of projectfile3,v
Working ConcurrentlyUsers savvypac or gshute could check out theteamproject directory at the same time:
% whoamigshute
% cvs checkout teamprojectcvs checkout: Updating teamprojectU teamproject/projectfile1U teamproject/projectfile2cvs checkout: Updating teamproject/subdirU teamproject/subdir/projectfile3
% cd teamproject% lsCVS/ projectfile1 projectfile2 subdir/
% cd subdir% lsCVS/ projectfile3
% cat projectfile3This is project file 3.Here is a new line. // change made by tcolburn
Updating
When working concurrently, you need to be sure youhave any changes that have been committed byanother team member.
Suppose gshute commits another change toprojectfile3.
To see the change, tcolburn must do an update:3% cvs updatecvs update: Updating .U projectfile3
14% cat projectfile3This is project file 3.Here is a new line.Here is another new line. // change made by gshute
Adding FilesSuppose tcolburn creates a new file in the teamproject/subdir directory. Before it can becommitted, it must be added:
% lsCVS projectfile3 projectfile4
% cvs add projectfile4cvs add: scheduling file `projectfile4' for additioncvs add: use 'cvs commit' to add this file permanently
% cvs commit -m "A new file" projectfile4RCS file: /home/vole/19/savvypac.../subdir/projectfile4,vdoneChecking in projectfile4;/home/vole/19/savvypac.../subdir/projectfile4,v <-- projectfile4initial revision: 1.1done
Adding Files (cont'd)
For gshute to see the new file, an update must bedone:
% whoamigshute
% lsCVS/ projectfile3
% cvs updatecvs update: Updating .U projectfile4
% lsCVS/ projectfile3 projectfile4
Adding Directories
● The add command is also used for directories● However, add is not recursive; a separate add
must be done for each file and each directory● If you want to add a whole directory hierarchy,
use import