home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / octa21eb.zip / octave / PATOS2.ZIP / patch-docs.cmd < prev    next >
OS/2 REXX Batch file  |  1997-08-13  |  2KB  |  86 lines

  1. /*
  2. *******************************************************************************
  3. ** This file patches the original documentation to ensure it can be used
  4. ** under OS/2 (for compiling and viewing). The original documentation will
  5. ** be saved in the directory structure doc.orig.
  6. ** (c) Klaus Gebhardt, 1997
  7. *******************************************************************************
  8. */
  9.  
  10. '@echo off'
  11.  
  12. DOCDIR = 'doc';
  13.  
  14. call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  15. call SysLoadFuncs
  16.  
  17. 'SETLOCAL'
  18. 'SET DELDIR='
  19.  
  20. say 'info: creating backup ...'
  21. 'ren' DOCDIR DOCDIR'.orig'
  22. 'xcopy' DOCDIR'.orig' DOCDIR'\ /S /E >NUL'
  23. 'cd' DOCDIR
  24.  
  25. 'rm -f ChangeLog *.in texinfo.tex'
  26. call patch
  27.  
  28. 'cd faq'
  29. 'rm -f *.in *.dvi *.ps *.info*'
  30. 'ren Octave-faq.* oct-faq.*'
  31. 'mv oct-faq.texi oct-faq.texi.orig'
  32. 'sed -e "s/Octave-FAQ\.info/oct-faq\./g" oct-faq.texi.orig > oct-faq.texi'
  33. 'rm -f oct-faq.texi.orig'
  34. call patch
  35. 'cd ..'
  36.  
  37. 'cd interpreter'
  38. 'rm -f dir *.in *.dvi *.ps *.info*'
  39. 'mv octave.texi octave.texi.orig'
  40. 'sed -e "s/octave\.info/octave\./g" octave.texi.orig > octave.texi'
  41. 'rm -f octave.texi.orig'
  42. call patch
  43. 'cd ..'
  44.  
  45. 'cd liboctave'
  46. 'rm -f *.in *.dvi *.ps *.info*'
  47. 'ren liboctave.* liboct.*'
  48. 'mv liboct.texi liboct.texi.orig'
  49. 'sed -e "s/liboctave\.info/liboct\./g" liboct.texi.orig > liboct.texi'
  50. 'rm -f liboct.texi.orig'
  51. call patch
  52. 'cd ..'
  53.  
  54. 'cd refcard'
  55. 'rm -f *.in'
  56. 'ren refcard.* rfc.*'
  57. 'ren refcard-a4.* rfc-a4.*'
  58. 'ren refcard-legal.* rfc-leg.*'
  59. 'ren refcard-letter.* rfc-let.*'
  60. 'cd ..'
  61.  
  62. 'cd ..'
  63.  
  64. 'ENDLOCAL'
  65. exit
  66.  
  67. patch: procedure
  68. rc = SysFileTree('*.texi', 'texinfo', 'FO');
  69. if (rc == 0) then
  70.   do
  71.     do i=1 to texinfo.0
  72.       say 'info: patching' texinfo.i '...'
  73.       file = FILESPEC('name', texinfo.i);
  74.       'mv' file file'.orig'
  75.       'sed -e "s/\.texi/\.tex/g"' file'.orig >' file
  76.       'rm -f' file'.orig'
  77.     end
  78.     'ren *.texi *.tex'
  79.   end
  80. else
  81.   do
  82.     say 'error: Not enough memory.'
  83.     exit;
  84.   end
  85. return;
  86.