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

  1. #!/bin/sh
  2. #+++
  3. #    NAME    : sccs_edit
  4. #    PURPOSE : get read/write version of files 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_edit  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_edit  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. export SCCS  PROJECTDIR
  33. #------------------------------------------------------------------------
  34. # verify existence of sccs directory
  35. #------------------------------------------------------------------------
  36. if test ! -d  $SCCS
  37. then
  38.     echo "$SCCS does not exist ; "
  39.     echo "use sccs_admin to create $SCCS."
  40.     exit 1
  41. fi
  42. #------------------------------------------------------------------------
  43. # get each requested file in editable form if it exists under sccs
  44. #------------------------------------------------------------------------
  45. for i
  46. do
  47.     if test  -s $SCCS/s.$i
  48.     then
  49.         #-------------------------------------------------------
  50.         # do not sccs_edit $i if a writable version exists
  51.         #-------------------------------------------------------
  52.         if test -w $i
  53.         then
  54.             echo "writable $i exists; sccs_edit $i aborted"
  55.         else 
  56.             #-------------------------------------------------
  57.             # if a (non-writable) version exists then remove it
  58.             #-------------------------------------------------
  59.             if test -f $i
  60.             then
  61.                 rm -f $i
  62.             fi
  63.             echo "get -p -e -t $SCCS/s.$i > $i"
  64.             get -p -e -t $SCCS/s.$i > $i
  65.         fi
  66.     else
  67.         echo "sccs_edit of $i ABORTED"
  68.         echo "$SCCS/s.$i does not exist or is zero length; "
  69.         echo "if SCCS/s.$i exists then delete it and retrieve $i"
  70.         echo "from src_backup or elsewhere and"
  71.         echo "use sccs_admin to place $i under sccs administration."
  72.     fi
  73. done
  74.