home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / sccs_b / part01 / sccs_delta < prev    next >
Encoding:
Text File  |  1990-09-20  |  2.7 KB  |  85 lines

  1. #!/bin/sh
  2. #+++
  3. #    NAME    : sccs_delta
  4. #    PURPOSE : introduce changes to a file under SCCS
  5. #    AUTHOR    :  W. Hatch
  6. #            Coleman Research
  7. #            14504 Greenview Drive Suite 500
  8. #            Laurel, Maryland 20708
  9. #            (301)470-3839
  10. #            uunet!bis!bill
  11. #    DATE    : 7/18/88
  12. #    PROJECT    : WEH SOFTWARE
  13. #    USAGE    : sccs_delta  file1  file2  ....
  14. #    RESTRICTIONS : file name lengths must be <= 12 characters
  15. #---
  16. #------------------------------------------------------------------------
  17. # if no command line arguments then abort with usage instructions
  18. #------------------------------------------------------------------------
  19. usage="sccs_delta  file1  file2  ....  "
  20. case $# in
  21.     0) echo $usage
  22.        exit;;
  23. esac
  24. #------------------------------------------------------------------------
  25. # if project directory is not defined then make it the current directory
  26. #------------------------------------------------------------------------
  27. PROJECTDIR=${PROJECTDIR-.}
  28. #------------------------------------------------------------------------
  29. # define sccs and source backup directories relative to project directory
  30. #------------------------------------------------------------------------
  31. SCCS=$PROJECTDIR/SCCS
  32. BACKUP=$PROJECTDIR/src_backup
  33. export SCCS  PROJECTDIR BACKUP
  34. #------------------------------------------------------------------------
  35. # verify existence of sccs and source backup directories
  36. #------------------------------------------------------------------------
  37. if test ! -d  $SCCS
  38. then
  39.     echo "$SCCS does not exist ; "
  40.     echo "use sccs_admin to create $SCCS"
  41.     exit 1
  42. fi
  43. if test ! -d $BACKUP
  44. then
  45.     echo "$BACKUP does not exist;"
  46.     echo "use sccs_admin to create $BACKUP."
  47.     exit 1
  48. fi
  49.  
  50. #------------------------------------------------------------------------
  51. # perform delta for each requested file that is under sccs
  52. #------------------------------------------------------------------------
  53. for i
  54. do
  55.     if test  -s $i
  56.     then
  57.         if test  -f $SCCS/s.$i
  58.         then
  59.             #-------------------------------------------------------
  60.             # backup before sccs removes original source file
  61.             #-------------------------------------------------------
  62.             if test -w  $i
  63.             then
  64.                 cp $i $BACKUP/$i
  65.                 echo "delta -y $SCCS/s.$i"
  66.                 delta -y"" $SCCS/s.$i 
  67.             else
  68.                 echo "no writable $i exists; abort sccs_delta"
  69.             fi
  70.         else
  71.             echo "$SCCS/s.$i does not exist; "
  72.            echo "you can not delta a file that is not under sccs control."
  73.             echo "use assc_admin to place $i under sccs control."
  74.         fi
  75.     else
  76.         echo "$i does not exist or is zero size; abort sccs_delta"
  77.         echo "see rmdel(1) to remove previous deltas and "
  78.         echo "reconstruct the file from SCCS/s.$i or get a"
  79.         echo "copy of the file from src_backup.  "
  80.         echo "BE CAREFUL not to blow away all copies of $i"
  81.     fi
  82.     
  83. done
  84.  
  85.