Changeset 597 for trunk


Ignore:
Timestamp:
Apr 2, 2007, 10:42:36 PM (19 years ago)
Author:
John Small
Message:
  • Removed support for "dummy" files. Warpin 1-0-15 now supports

packages without files. Now "empty" packages have a files named
"NUL" added.

  • Improved error messages
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/warpin/bld_fm2_wpidirs.cmd

    r584 r597  
    55 *
    66 * TODO:
    7  *    -  Once the new dummy file idea is accepted and debugged, change this and *.TXT
    8  *       so that the filename is not included in *.TXT. (Or implement the
    9  *       auto-determination of needed dummy files.)
    10  *    -  Add logic to figure out "DUMMYFILE" needs automatically
    11  *    -  Try setting +r attrib on DUMMYFILE's?
    127 *    -  Add logic to read script to determine
    138 *       -  Number of packages
     
    5045         dest_dir = dest_basedir || '\' || WPI.pkg.p.file.f.dest
    5146         '@if not exist 'dest_dir'\. md 'dest_dir
    52          if WPI.pkg.p.file.f.src = 'DUMMY:' then
    53             do
    54                dummy_filename = dest_dir || '\' || 'Keep_Me.' || right(WPI.pkg.p.number, length(WPI.max_package_number), '0')
    55                '@if exist 'dummy_filename' del 'dummy_filename' 1>NUL 2>NUL'
    56                call lineout dummy_filename, ''
    57                call lineout dummy_filename, 'Due to limitations of Warpin that existed at the time this FM/2 install'
    58                call lineout dummy_filename, 'was developed, this otherwise pointless file is REQUIRED.'
    59                call lineout dummy_filename, ''
    60                call lineout dummy_filename, 'Please do NOT modify or delete this file.'
    61                call lineout dummy_filename, ''
    62                call lineout dummy_filename              /* This closes the file */
    63 /*
    64                'attrib 'dummy_filename' +r'
    65 */
    66                say 'Warpin dummy file: "'dummy_filename || '" written.'
    67             end
    68          else
    69             do
    70                'copy ' || WPI.src_basedir || WPI.pkg.p.file.f.src || '\' || WPI.pkg.p.file.f.name || ' ' || dest_dir
    71 /*
    72                if translate(right(WPI.pkg.p.file.f.name, 4)) == '.CMD' then
    73                   'eautil ' || dest_dir || '\' || WPI.pkg.p.file.f.name || ' NUL /s'
    74 */
    75             end
     47         'copy ' || WPI.src_basedir || WPI.pkg.p.file.f.src || '\' || WPI.pkg.p.file.f.name || ' ' || dest_dir
    7648      end
    7749end
    7850
    79 if WPI.retval \= 0 then
    80    signal ErrorExit
    81    '@if exist bld_fm2_wpidirs.last del bld_fm2_wpidirs.last'
    82    call lineout 'bld_fm2_wpidirs.last'
     51if WPI.retval = 0 then
    8352   signal NormalExit
    8453
    8554ErrorExit:
    8655   parse arg errorcode
    87    say 'Error code: 'errorcode
     56   select
     57      when errorcode = 1 then
     58         say 'Error: More than one PACKAGECOUNT line in 'WPI.infile
     59      when errorcode = 2 then
     60         say 'Error: More than PACKAGECOUNT PACKAGE lines in 'WPI.infile
     61      when errorcode = 3 then
     62         do
     63            say 'Error: Too many tokens on a line in 'WPI.infile
     64            say 'Line : 'txtline
     65         end
     66      when errorcode = 4 then
     67         say 'Error: Keyword is not PACKAGECOUNT, PACKAGE or FILE in 'WPI.infile
     68      when errorcode = 5 then
     69novalue:
     70         do
     71            say 'Error: Unitialized value: "' || condition('D') || ' encountered on line: 'sigl
     72            say '   'sourceline(sigl)
     73            signal NormalExit
     74         end
     75      when errorcode = 6 then
     76         do
     77            say 'Error: Duplicate PACKAGE line in 'WPI.infile
     78            say 'Line : 'txtline
     79         end
     80      when errorcode = 7 then
     81         do
     82            say 'Error: Invalid package number in 'WPI.infile
     83            say 'Line : 'txtline
     84         end
     85      otherwise
     86         say 'Error: unknown error code: 'errorcode
     87   end
    8888   say
    8989   say 'Exiting...'
     
    9393   n = endlocal()
    9494   exit WPI.retval
    95 
    96 novalue:
    97    say 'Error: Unitialized value: "' || condition('D') || ' encountered on line: 'sigl
    98    say '   'sourceline(sigl)
    99    call ErrorExit 5
    10095
    10196ReadFile: procedure expose (globals)
     
    119114               WPI.pkg.0 = word(txtline, 2)
    120115            else
    121                call ErrorExit 1      /* More than one PACKAGECOUNT */
     116               call ErrorExit 1           /* More than one PACKAGECOUNT */
    122117         when word1 == 'PACKAGE:' then
    123118            do
    124119               parse var txtline . pkgnum pkgdesc
    125120               if wordpos(pkgnum, package_number_list) > 0 then
    126                   call ErrorExit 6
     121                  call ErrorExit 6         /* Repeated package line */
    127122               package_number_list = package_number_list pkgnum
    128123               p = words(package_number_list)
    129                if p > WPI.pkg.0 then        /*  More packages than PACKAGECOUNT?  */
    130                   call ErrorExit 2
     124               if p > WPI.pkg.0 then
     125                  call ErrorExit 2        /*  More packages than PACKAGECOUNT  */
    131126               WPI.pkg.p.number = pkgnum
    132127               WPI.pkg.p.desc = strip(pkgdesc)
    133128            end
    134          when (word1 == 'FILE:' | word1 == 'DUMMYFILE:') then
     129         when (word1 == 'FILE:') then
    135130            do
    136                if word1 == 'DUMMYFILE:' then
    137                   parse var txtline . filename pkgnum filedest rest
    138                else
    139                   parse var txtline . filename pkgnum filesrc filedest rest
     131               parse var txtline . filename pkgnum filesrc filedest rest
    140132               p = wordpos(pkgnum, package_number_list)
    141133               if p = 0 then
     
    153145                        WPI.pkg.p.file.0      = i
    154146                        WPI.pkg.p.file.i.name = filename
    155                         if word1 == 'DUMMYFILE:' then
    156                            WPI.pkg.p.file.i.src  = 'DUMMY:'
     147                        if WPI.src_basedir \= '..\' then  /* Ignore src-dir if not using build subtree */
     148                           WPI.pkg.p.file.i.src  = '.'
    157149                        else
    158                            if WPI.src_basedir \= '..\' then  /* Ignore src-dir if not using build subtree */
    159                               WPI.pkg.p.file.i.src  = '.'
    160                            else
    161                               WPI.pkg.p.file.i.src  = filesrc
     150                           WPI.pkg.p.file.i.src  = filesrc
    162151                        WPI.pkg.p.file.i.dest = filedest
    163152                     end
Note: See TracChangeset for help on using the changeset viewer.