home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / bin / patch-metamail.z / patch-metamail
Encoding:
Text File  |  1997-01-22  |  1.2 KB  |  46 lines

  1. #!/bin/csh -fb
  2. # (The "-fb" might need to be changed to "-f" on some systems)
  3. #
  4. set HOSTNAME=thumper.bellcore.com
  5. set DIRNAME=pub/nsb
  6. set PREFIX="mm.patch."
  7.  
  8. if ($#argv < 2 || $#argv > 5) then
  9.     echo Usage:  patch-metamail source-tree-root patch-number [hostname [dirname [prefix]]]
  10.     exit -1
  11. endif
  12.  
  13. set TREEROOT=$1
  14. set PATCHNUMBER=$2
  15. if ($#argv > 2) set HOSTNAME=$3
  16. if ($#argv > 3) set DIRNAME=$4
  17. if ($#argv > 4) set PREFIX=$5
  18.     
  19. echo WARNING:  This program, if allowed to do so, will attempt to 
  20. echo install a PATCH file for your metamail sources which are rooted 
  21. echo in the directory $TREEROOT.
  22. echo ""
  23. echo It will use a patch file that it retrieves via anonymous ftp
  24. echo from the host $HOSTNAME, in the directory $DIRNAME, 
  25. echo with filenames starting with ${PREFIX}.
  26. echo ""
  27. echo -n "Do you want to install the patch in directory $TREEROOT [y/n] ? "
  28. set ans=$<
  29. if ($ans == "y" || $ans == "Y") then
  30.     cd $TREEROOT
  31.     set ident=`whoami`@`hostname`
  32.     echo Using anonymous ftp with password $ident
  33.     ftp -n <<!
  34. open $HOSTNAME
  35. user anonymous $ident
  36. cd $DIRNAME
  37. binary
  38. get ${PREFIX}${PATCHNUMBER}
  39. quit
  40. !
  41.     patch -p < ${PREFIX}${PATCHNUMBER}
  42. else
  43.     echo Patch not installed
  44. endif
  45.  
  46.