home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #+++
- # NAME : sccs_delta
- # PURPOSE : introduce changes to a file 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_delta file1 file2 ....
- # RESTRICTIONS : file name lengths must be <= 12 characters
- #---
- #------------------------------------------------------------------------
- # if no command line arguments then abort with usage instructions
- #------------------------------------------------------------------------
- usage="sccs_delta 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
-
- #------------------------------------------------------------------------
- # perform delta for each requested file that is under sccs
- #------------------------------------------------------------------------
- for i
- do
- if test -s $i
- then
- if test -f $SCCS/s.$i
- then
- #-------------------------------------------------------
- # backup before sccs removes original source file
- #-------------------------------------------------------
- if test -w $i
- then
- cp $i $BACKUP/$i
- echo "delta -y $SCCS/s.$i"
- delta -y"" $SCCS/s.$i
- else
- echo "no writable $i exists; abort sccs_delta"
- fi
- else
- echo "$SCCS/s.$i does not exist; "
- echo "you can not delta a file that is not under sccs control."
- echo "use assc_admin to place $i under sccs control."
- fi
- else
- echo "$i does not exist or is zero size; abort sccs_delta"
- echo "see rmdel(1) to remove previous deltas and "
- echo "reconstruct the file from SCCS/s.$i or get a"
- echo "copy of the file from src_backup. "
- echo "BE CAREFUL not to blow away all copies of $i"
- fi
-
- done
-
-