home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 29 Fixes_o / 29-Fixes_o.zip / ctc308.zip / updpakg.cmd < prev    next >
OS/2 REXX Batch file  |  1997-07-29  |  2KB  |  75 lines

  1. /*****************************************************************************/
  2. /* IBM(R) VisualAge(TM) C++ for OS/2(R), Version 3                           */
  3. /* (C)Copyright IBM Corp. 1995.                                              */
  4. /* - Licensed Material - Program-Property of IBM - All Rights Reserved       */
  5. /*****************************************************************************/
  6. /**************************************************************/
  7. /* This routine updates the package file                      */
  8. /**************************************************************/
  9. "@echo off"
  10. arg filename add_file
  11.  
  12. output_file = filename
  13. output_file = strip(output_file, 'T')
  14. output_file = overlay('out', output_file, length(output_file) - 2)
  15.  
  16. done = FALSE
  17. c_done = FALSE
  18. first_time = TRUE
  19.  
  20. do until lines(filename) = 0
  21.   record = linein(filename)                     /* Read the record    */
  22.   call lineout output_file, record              /* Write the record   */
  23.  
  24.   if (first_time = TRUE) then
  25.   do
  26.      first_time = FALSE
  27.      if (RESULT) then
  28.      do
  29.         SAY "Unable to write to vacpp.out"
  30.         SAY "Cannot update package file successfully."
  31.         c_done = TRUE
  32.         LEAVE
  33.      end
  34.   end
  35.  
  36.   if ( word(record, 1) = 'COMPONENT' &  done = FALSE ) then
  37.   do
  38.      next_rec = linein(filename)
  39.      if (word(next_rec, 3) = " 'Compiler " & word(next_rec, 4) = " and ") then
  40.      do
  41.          add_rec = linein(add_file)
  42.          do until ( lines(add_file) = 0 )
  43.            add_rec = linein(add_file)
  44.            call lineout output_file, add_rec
  45.          end
  46.  
  47.          record = linein(filename)
  48.          do until ( word(record, 1) = 'COMPONENT' | lines(filename) = 0 )
  49.            record = linein(filename)
  50.          end
  51.  
  52.          if (lines(filename) = 0) then
  53.          do
  54.             SAY "Cannot update package file successfully."
  55.             SAY "Check vacpp.pkg on your system."
  56.             done = TRUE
  57.          end
  58.          else
  59.             call lineout output_file, record              /* Write the record   */
  60.  
  61.          c_done = TRUE
  62.      end
  63.      else
  64.          call lineout output_file, next_rec
  65.   end
  66.  
  67. end
  68.  
  69. if (c_done = FALSE) then
  70. do
  71.    SAY "Cannot update package file successfully."
  72.    SAY "Check vacpp.pkg on your system."
  73. end
  74.  
  75.