Changeset 3540 for trunk/tools


Ignore:
Timestamp:
May 15, 2000, 3:57:58 PM (25 years ago)
Author:
bird
Message:

Changed to new packing style.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/DailyBuild/odin32pack.cmd

    r3451 r3540  
    1 /* $Id: odin32pack.cmd,v 1.1 2000-04-27 11:32:25 bird Exp $
     1/* $Id: odin32pack.cmd,v 1.2 2000-05-15 13:57:58 bird Exp $
    22 *
    33 * Make the two zip files.
     
    1010 *
    1111 */
    12     'cd bin\debug'
    13     if RC <> 0 then call failure rc, 'ChDir to bin\debug failed.';
    14     call packdir 'debug'
     12    sStartDir = directory();
    1513
    16     'cd ..\..\bin\release'
    17     if RC <> 0 then call failure rc, 'ChDir to bin\release failed.';
    18     call packdir 'release'
    19     'cd ..\..';
     14    call ChDir 'bin';
     15    call packdir 'debug', 'debug'
     16    call packdir 'release', 'release'
     17    call ChDir '..';
    2018
    2119    exit(0);
    2220
    23 packdir: procedure
    24 parse arg stype;
    25     'del /Q /Y /Z *.cmd'
    26     'del /Q /Y /Z /X CVS'
    27     'del /Q /Y /Z /X .\glide\CVS'
    28     'del /Q /Y /Z /X .\glide\Voodoo1\CVS'
    29     'del /Q /Y /Z /X .\glide\Voodoo2\CVS'
    30     'copy ..\odin.ini odin.ini'
    31     if (RC <> 0) then call failure rc, 'copy odin.ini to bin failed.';
    32     'copy ..\..\license.txt'
    33     if (RC <> 0) then call failure rc, 'copy license.txt to bin failed.';
    34     'copy ..\..\readme.txt'
    35     if (RC <> 0) then call failure rc, 'copy readme.txt to bin failed.';
    36     'copy ..\..\logging.txt logging.txt'
    37     if (RC <> 0) then call failure rc, 'copy logging.txt to bin failed.';
    38     'copy ..\..\odin.ini.txt .\odin_ini.txt'
    39     if (RC <> 0) then call failure rc, 'copy odin.ini.txt to bin failed.';
    40     'copy ..\..\ChangeLog'
    41     if (RC <> 0) then call failure rc, 'copy ChangeLog to bin failed.';
    42     'copy ..\Glide\readme.txt Glide\readme.txt'
    43     if (RC <> 0) then call failure rc, 'copy a Glide\readme.txt to bin failed.';
    44     'copy ..\Glide\Voodoo1\readme.txt Glide\Voodoo1\readme.txt'
    45     if (RC <> 0) then call failure rc, 'copy a Glide\Voodoo1\readme.txt to bin failed.';
    46     'copy ..\Glide\Voodoo2\readme.txt Glide\Voodoo2\readme.txt'
    47     if (RC <> 0) then call failure rc, 'copy a Glide\Voodoo2\readme.txt to bin failed.';
     21packdir: procedure expose sStartDir;
     22parse arg sDir, sType;
    4823
    49     'zip -9 -R ..\..\odin32bin-' || DATE(S) || '-' || stype || '.zip * -xCVS';
    50     if (RC <> 0) then call failure rc, 'zip...';
     24    sZipFile = filespec('path', directory())||'odin32bin-' || DATE(S) || '-' || sType || '.zip';
     25
     26    /*
     27     * Change into the directory we're to pack and do some fixups
     28     */
     29    call ChDir sDir
     30    'del /Q /Y /Z *.cmd > nul 2>&1'
     31    'del /Q /Y /Z /X CVS > nul 2>&1'
     32    'del /Q /Y /Z /X .\glide\CVS > nul 2>&1'
     33    'del /Q /Y /Z /X .\glide\Voodoo1\CVS > nul 2>&1'
     34    'del /Q /Y /Z /X .\glide\Voodoo2\CVS > nul 2>&1'
     35    call copy '..\odin.ini'
     36    call copy '..\..\odin.ini.txt', '.\odin_ini.txt'
     37    call copy '..\Glide\readme.txt', 'Glide\readme.txt'
     38    call copy '..\Glide\Voodoo1\readme.txt', 'Glide\Voodoo1\readme.txt'
     39    call copy '..\Glide\Voodoo2\readme.txt', 'Glide\Voodoo2\readme.txt'
     40
     41    /*
     42     * Create a pack directory in /bin and go into it.
     43     * (Don't test on return from mkdir while the directory might exist.)
     44     */
     45    'mkdir ..\pack'
     46    call ChDir '..\pack'
     47    'del /Q /Y /Z *' /* Perform some cleanup */
     48
     49    /* Copy root files into the pack directory. */
     50    call copy '..\..\license.txt';
     51    call copy '..\..\readme.txt';
     52    call copy '..\..\logging.txt';
     53    call copy '..\..\ChangeLog';
     54
     55    /*
     56     * Move (=rename) the /bin/<release|debug> dir into /pack/system32
     57     * and pack it.
     58     */
     59    'ren ..\'||sDir '.\system32'
     60    if (RC <> 0) then call failure rc, 'renaming' sDir'->system32 failed';
     61
     62    say 'zip -9 -R' sZipFile '* -xCVS';
     63    'zip -9 -R' sZipFile '* -xCVS';
     64    if (RC <> 0) then
     65    do
     66        rc2 = rc;
     67        'ren .\system32 ..\'||sDir
     68        call failure rc2, 'zip...';
     69    end
     70    'ren .\system32 ..\'||sDir
     71    if (RC <> 0) then call failure rc, 'renaming' sDir'->system32 failed';
     72
     73    /* restore directory */
     74    call ChDir '..';
    5175    return;
    5276
    53 failure: procedure
     77/*
     78 * Changes the directory.
     79 * On error we will call failure.
     80 */
     81ChDir: procedure expose sStartDir;
     82    parse arg sDir
     83
     84    'cd' sDir
     85    if (rc <> 0) then
     86    do
     87        call failure rc, 'Failed to ChDir into' sDir '(CWD='directory()').'
     88        return rc;
     89    end
     90    return 0;
     91
     92
     93/*
     94 * Copy a file.
     95 * On error we will call failure.
     96 */
     97Copy: procedure expose sStartDir
     98    parse arg sSrc, sDst
     99
     100    /* if no sDst set default */
     101    if (sDst = '') then sDst='.';
     102    'copy' sSrc sDst
     103    if (rc <> 0) then
     104    do
     105        call failure rc, 'Copying' sSrc 'to' sDst 'failed.'
     106        return rc;
     107    end
     108    return 0;
     109
     110
     111/*
     112 * Complain about a failure and exit the script.
     113 * Note. Uses the global variable sStartDir to restore the current
     114 *       directory where the script was started from.
     115 * @param rc    Error code to write. (usually RC)
     116 * @param sText Description.
     117 */
     118failure: procedure expose sStartDir;
    54119parse arg rc, sText;
    55120    say 'rc='rc sText
    56     'cd ..\..';
     121    call directory sStartDir;
    57122    exit(rc);
    58123
Note: See TracChangeset for help on using the changeset viewer.