home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnusmalltalk / mk_mst_diffs < prev    next >
Text File  |  1992-02-15  |  2KB  |  56 lines

  1. #!/bin/csh -f
  2.  
  3. # This file computes the differences between the original version of the 
  4. # GNU Smalltalk source files and the current version of the same.  It's
  5. # end result is the file mst.diffs that contains those differences in a format
  6. # that can be applied to patch to upgrade some other person's version of
  7. # GNU Smalltalk to your current version.
  8.  
  9. # The entire process is driven off the file "mstfiles".  This file contains the
  10. # names of all of the files that make up the GNU Smalltalk distribution.  If
  11. # you add any files, you should be sure to add them to this file.
  12. #
  13. # Usage:
  14. #    mk_mst_diffs [ origDir ]
  15. #
  16. # origDir is a version of the Smalltalk directory hierarchy to compare
  17. # against; it is the baseline, and defaults to "./orig"
  18.  
  19.  
  20. set origDir = ./orig
  21. if ($#argv > 0) then
  22.     set origDir = $1
  23. endif
  24.  
  25. set path=($cwd $path)        # make sure that any cd's don't lose us
  26.  
  27. print_file_names `cat mstfiles` | sort > mstfiles.srt
  28.  
  29. print_file_names -d ${origDir} `cat ${origDir}/mstfiles` | sort > mstfiles.osrt
  30.  
  31. comm -23 mstfiles.srt mstfiles.osrt > mstfiles.dif
  32.  
  33. foreach file (`cat mstfiles.dif`)
  34.     if ( -d $file )  then 
  35.     echo "You created new directory '$file'"
  36.       mkdir ${origDir}/$file
  37.     else 
  38.     echo "You created new file '$file'"
  39.     touch ${origDir}/$file 
  40.     endif
  41. end
  42. rm -rf mstfiles.osrt mstfiles.dif mst.diffs
  43.  
  44. foreach file (`cat mstfiles.srt`)
  45.     if (-f ${file} ) then
  46.     diff -c ${origDir}/${file} ./${file} > a.diff
  47.     if (${status} == 1) then
  48.         cat a.diff >> mst.diffs
  49.     endif
  50.     endif
  51. end
  52.  
  53. rm -rf mstfiles.srt a.diff
  54.  
  55. exit 0
  56.