home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #+++
- # NAME : sccs_edit
- # PURPOSE : get read/write 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_edit file1 file2 ....
- # RESTRICTIONS : file name lengths must be <= 12 characters
- #---
- #------------------------------------------------------------------------
- # if no command line arguments then abort with usage instructions
- #------------------------------------------------------------------------
- usage="sccs_edit 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
- export SCCS PROJECTDIR
- #------------------------------------------------------------------------
- # verify existence of sccs directory
- #------------------------------------------------------------------------
- if test ! -d $SCCS
- then
- echo "$SCCS does not exist ; "
- echo "use sccs_admin to create $SCCS."
- exit 1
- fi
- #------------------------------------------------------------------------
- # get each requested file in editable form if it exists under sccs
- #------------------------------------------------------------------------
- for i
- do
- if test -s $SCCS/s.$i
- then
- #-------------------------------------------------------
- # do not sccs_edit $i if a writable version exists
- #-------------------------------------------------------
- if test -w $i
- then
- echo "writable $i exists; sccs_edit $i aborted"
- else
- #-------------------------------------------------
- # if a (non-writable) version exists then remove it
- #-------------------------------------------------
- if test -f $i
- then
- rm -f $i
- fi
- echo "get -p -e -t $SCCS/s.$i > $i"
- get -p -e -t $SCCS/s.$i > $i
- fi
- else
- echo "sccs_edit of $i ABORTED"
- echo "$SCCS/s.$i does not exist or is zero length; "
- echo "if SCCS/s.$i exists then delete it and retrieve $i"
- echo "from src_backup or elsewhere and"
- echo "use sccs_admin to place $i under sccs administration."
- fi
- done
-