Changeset 610


Ignore:
Timestamp:
Apr 19, 2007, 12:46:37 AM (19 years ago)
Author:
John Small
Message:
  • Most of the improved WPI build process is implemented in this

program. As long as BLD_FM2_WPIDIRS.TXT has not changed and as
long as FM2.WPI exists, then ONLY changed files are staged for
(and later added to) the WPI file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/warpin/ckfiles.cmd

    r590 r610  
    77
    88wpi_file          =  'fm2.wpi'
    9 flag_file         =  'lastfile.upd'
    10 dummy_date_time   =  '99 99 99 23 59 59'
    11 wpi_file_date_time=  GetDate(wpi_file)
    12 if wpi_file_date_time = dummy_date_time then
    13    return
     9wis_file          =  'fm2.wis'
     10dummy_date_time   =  '-1'
     11in_file   =  'bld_fm2_wpidirs.txt'
     12out_file  =  'bld_fm2_wpidirs.in'
     13retval      = 0
    1414
    15 infile   =  'bld_fm2_wpidirs.txt'
    1615
    17 retval = 0
    18 do while lines(infile) > 0
    19    line = translate(strip(linein(infile)))
    20    if line \= '' then
    21       if word(line, 1) = 'FILE:' then
     16in_file_date_time=  GetDate(in_file)
     17if in_file_date_time = dummy_date_time then
     18   do
     19      say 'Fatal Error: input file, 'in_file' NOT found.'
     20      say
     21      say 'Exiting...'
     22      return
     23   end
     24out_file_date_time = GetDate(out_file)
     25wpi_file_date_time = GetDate(wpi_file)
     26
     27if in_file_date_time > out_file_date_time | ,
     28   out_file_date_time = dummy_date_time  | ,
     29   wpi_file_date_time = dummy_date_time then
     30   do
     31      'copy 'in_file out_file
     32      call SysSetFileDateTime out_file
     33      if stream(wpi_file, 'c', 'query exists') \= '' then
     34         'del 'wpi_file
     35      call clean_wpidirs
     36   end
     37else
     38   do
     39      file_reset  = 0
     40      nfp         = 0
     41      do while lines(in_file) > 0
     42         line = strip(linein(in_file))
     43         if line \= '' then
     44            if left(line, 1) \= ';' then
     45               if translate(word(line, 1)) = 'FILE:' then
     46                  do
     47                     file  =  word(line, 2)
     48                     dir   =  word(line, 4)
     49                     file_date_time = GetDate( '..\' || dir || '\' || file )
     50                     if file_date_time > out_file_date_time then
     51                        do
     52                           if file_reset = 0 then
     53                              do
     54                                 file_reset = 1
     55                                 if stream(out_file, 'c', 'query exists') \= '' then
     56                                    '@del 'out_file
     57                                 call lineout out_file, '; Do not edit this file!'
     58                                 call lineout out_file, ';'
     59                                 call lineout out_file, '; Any desired edits should be done to BLD_FM2_WPIDIRS.TXT, instead.'
     60                                 call lineout out_file, ';'
     61                              end
     62                           call lineout out_file, line
     63                        end
     64                  end
     65               else /* must be a NOFILESPACKAGE line */
     66                  do
     67                     nfp = nfp + 1
     68                     nfpline.nfp = line
     69                  end
     70
     71      end
     72      if file_reset = 1 then
    2273         do
    23             file  =  word(line, 2)
    24             dir   =  word(line, 4)
    25             file_date_time = GetDate( '..\' || dir || '\' || file )
    26             if file_date_time >  wpi_file_date_time then
    27                do
    28                   retval = 1
    29                   leave
    30 /*
    31                   'if exist 'flag_file' del 'flag_file
    32                   call lineout flag_file
    33 */
    34                end
     74            nfpline.0 = nfp
     75            do nfp = 1 to nfpline.0
     76               call lineout out_file, nfpline.nfp
     77            end
     78            call stream out_file, 'c', 'close'
    3579         end
    36 end
     80   end
    3781
    38 exit retval
     82exit
    3983
    40 GetDate: procedure expose dummy_date_time
    41    parse arg file
    42    call SysFileTree file, 'list.', 'FL'
    43    if list.0 \= 1 then
    44       return dummy_date_time
    45    else
    46       return translate(word(list.1, 1) word(list.1, 2), '   ', '-/:')
    47 return
     84GetDate: procedure
     85return SysGetFileDateTime( arg(1), 'W' )
    4886
    4987novalue:
Note: See TracChangeset for help on using the changeset viewer.