Changeset 1885


Ignore:
Timestamp:
Oct 20, 2015, 5:36:39 AM (10 years ago)
Author:
John Small
Message:

Ticket #574: Support multiple levels of destination directories

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/warpin/bld_fm2_wpidirs.cmd

    r1246 r1885  
    55 * FM/2 Warpin archive (WPI file).
    66 *
     7 * Change log:
     8 *    19 Oct 15 JBS Ticket #574: Support multiple levels of destination directories
     9 *
    710 * TODO:
    8  *    -  Support multiple levels of destination directories
    911 *    -  Add logic to read script to determine
    1012 *       -  Number of packages
     
    4042
    4143do f = 1 to WPI.fileline.0
    42    parse var WPI.fileline.f . filename pkgnum src_subdir dest_subdir
     44   parse var WPI.fileline.f . filename pkgnum src_subdir dest_subdir .
    4345   if WPI.src_basedir \= '..\' then  /* Ignore src_subdir from file if not using build subtree */
    4446      src_subdir = '.'
    4547   dest_basedir   = MakePackageDir( pkgnum )
    46    dest_dir = dest_basedir || '\' || strip(dest_subdir)
    47    call SysMkDir dest_dir
    48    'copy ' || WPI.src_basedir || src_subdir || '\' || filename || ' ' || dest_dir
     48   if dest_subdir \= '.' then
     49      call MkDir dest_basedir, dest_subdir
     50   'copy' WPI.src_basedir || src_subdir || '\' || filename || ' ' || dest_basedir || '\' || dest_subdir
    4951end
    5052
     
    5355
    5456ErrorExit:
     57   WPI.retval = 1
    5558   parse arg errorcode
    5659   select
     
    6871            say '   'sourceline(sigl)
    6972            signal NormalExit
     73         end
     74      when errorcode = 6 then
     75         do
     76            say 'Error: Unable to create package staging subdirectory.'
    7077         end
    7178      otherwise
     
    157164return full_dirname
    158165
     166/* Creates a directory, including any non-existant parents */
     167MkDir: procedure expose (globals)
     168   parse arg basedir, subdirs
     169   curdir = directory()
     170   do while subdirs \= ''
     171      parse var subdirs subdir '\' subdirs
     172      if subdir \= '.' then
     173         do
     174            dir = basedir || '\' || subdir
     175            if translate(dir) \= translate(right(directory(dir), length(dir))) then
     176               do
     177                  rcx = SysMkDir(dir)
     178                  if rcx \= 0 then
     179                     call ErrorExit 6
     180               end
     181            call directory curdir
     182            basedir = dir
     183         end
     184   end
     185return
     186
Note: See TracChangeset for help on using the changeset viewer.