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

  1. #!/bin/sh
  2. #+++
  3. #    NAME    : sccs_get
  4. #    PURPOSE : get read only 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_get  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_get  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. # get each requested file in read only form if it exists under sccs
  51. #------------------------------------------------------------------------
  52. for i
  53. do
  54.     #----------------------------------------------------------------
  55.     # abort the get if a writable version exists
  56.     # otherwise the file in $PROJECTDIR is trashed    
  57.     #----------------------------------------------------------------
  58.     if test -w $i
  59.     then
  60.         echo "$i exists for editing; abort sccs_get of $i"
  61.         echo "make sure $i is not zero length and"
  62.         echo "use sccs_admin or sccs_delta on writable version of $i"
  63.         echo "before attempting another sccs_get."
  64.     else
  65.         if test  -s $SCCS/s.$i
  66.         then
  67.             echo "get -p $SCCS/s.$i > $i; chmod ugo-w $i"
  68.             get -p $SCCS/s.$i > $i
  69.             chmod ugo-w $i
  70.         else
  71.             echo "$SCCS/s.$i does not exist or is zero length; "
  72.             echo "use sccs_admin to place $i under sccs."
  73.                     
  74.         fi
  75.     fi
  76. done
  77.  
  78.