home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #+++
- # NAME : sccs_get
- # PURPOSE : get read only version of files under SCCS
- # AUTHOR : W. Hatch
- # Coleman Research
- # 14504 Greenview Drive Suite 500
- # Laurel, Maryland 20708
- # (301)470-3839
- # uunet!bis!bill
- # DATE : 7/18/88
- # PROJECT : WEH SOFTWARE
- # USAGE : sccs_get file1 file2 ....
- # RESTRICTIONS : file name lengths must be <= 12 characters
- #---
- #------------------------------------------------------------------------
- # if no command line arguments then abort with usage instructions
- #------------------------------------------------------------------------
- usage="sccs_get file1 file2 .... "
- case $# in
- 0) echo $usage
- exit;;
- esac
- #------------------------------------------------------------------------
- # if project directory is not defined then make it the current directory
- #------------------------------------------------------------------------
- PROJECTDIR=${PROJECTDIR-.}
- #------------------------------------------------------------------------
- # define sccs and source backup directories relative to project directory
- #------------------------------------------------------------------------
- SCCS=$PROJECTDIR/SCCS
- BACKUP=$PROJECTDIR/src_backup
- export SCCS PROJECTDIR BACKUP
- #------------------------------------------------------------------------
- # verify existence of sccs and source backup directories
- #------------------------------------------------------------------------
- if test ! -d $SCCS
- then
- echo "$SCCS does not exist ; "
- echo "use sccs_admin to create $SCCS"
- exit 1
- fi
- if test ! -d $BACKUP
- then
- echo "$BACKUP does not exist;"
- echo "use sccs_admin to create $BACKUP."
- exit 1
- fi
- #------------------------------------------------------------------------
- # get each requested file in read only form if it exists under sccs
- #------------------------------------------------------------------------
- for i
- do
- #----------------------------------------------------------------
- # abort the get if a writable version exists
- # otherwise the file in $PROJECTDIR is trashed
- #----------------------------------------------------------------
- if test -w $i
- then
- echo "$i exists for editing; abort sccs_get of $i"
- echo "make sure $i is not zero length and"
- echo "use sccs_admin or sccs_delta on writable version of $i"
- echo "before attempting another sccs_get."
- else
- if test -s $SCCS/s.$i
- then
- echo "get -p $SCCS/s.$i > $i; chmod ugo-w $i"
- get -p $SCCS/s.$i > $i
- chmod ugo-w $i
- else
- echo "$SCCS/s.$i does not exist or is zero length; "
- echo "use sccs_admin to place $i under sccs."
-
- fi
- fi
- done
-
-