Changeset 9111 for trunk/tools


Ignore:
Timestamp:
Aug 24, 2002, 6:36:04 AM (23 years ago)
Author:
bird
Message:

NoValue signal handler. Respect BUILD_VERBOSE and BUILD_QUIET. Fixed an old typo.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bin/BldLevelInf.cmd

    r5030 r9111  
    1 /* $Id: BldLevelInf.cmd,v 1.5 2001-01-26 21:33:13 phaller Exp $
     1/* $Id: BldLevelInf.cmd,v 1.6 2002-08-24 04:36:04 bird Exp $
    22 *
    33 * Adds a Description string to the given .def-file.
     
    55 *
    66 */
     7
     8signal on novalue name NoValueHandler
    79
    810if RxFuncQuery('SysLoadFuncs') = 1 then
     
    3133
    3234/*
     35 * Config stuff.
     36 */
     37iVerbose        = 1;                    /* 0, 1 or 2. */
     38if (getenv("BUILD_QUIET") <> '') then
     39    iVerbose    = 0;
     40else if (getenv("BUILD_VERBOSE") <> '') then
     41    iVerbose    = 2;
     42sGlobals = 'iVerbose'
     43
     44/*
    3345 * Parse parameters.
    3446 */
     
    109121                sVendor         = sValue;
    110122
    111             when (ch = 'R') then /* Vendor */
    112                 sDescription    = ReadDescription(sValue, sDefFile);
     123            when (ch = 'R') then /* Description */
     124                sDescription    = ReadDescription(sValue, sDefFileIn);
    113125
    114126            when (ch = 'P') then /* Fixpak version */
     
    188200 */
    189201rc = UpdateDefFile(sDefFileIn, sDefFileOut, sDescription);
     202if (rc = 0 & iVerbose >= 1) then
     203    say 'BldLevelInf: Applied build info to '''sDefFileOut'''.';
    190204exit(rc);
    191205
     
    194208 * Display script syntax.
    195209 */
    196 syntax: procedure
     210syntax: procedure expose (sGlobals);
    197211    say 'Syntax: MakeDesc.cmd [options] <deffile in> <deffile out> [options]'
    198212    say '   <deffile>   Defitionfile which will have an DESCRIPTION appended.'
     
    227241 * @remark  Write only code... - let's hope it works.
    228242 */
    229 LookupDefine: procedure
     243LookupDefine: procedure expose (sGlobals);
    230244    parse arg '#'sDefine'='sMacro','sIncludeFile
    231245
     
    338352            call stream sIncludeFile, 'c', 'close';
    339353            sValue = substr(sLine, 2, iLastQuote - 2);
    340             say 'Found 'sMacro'='sValue;
     354            if (iVerbose >= 2) then
     355                say 'Found 'sMacro'='sValue;
    341356            return sValue;
    342357        end
     
    375390
    376391            call stream sIncludeFile, 'c', 'close';
    377             say 'Found 'sMacro'='sValue;
     392            if (iVerbose >= 2) then
     393                say 'Found 'sMacro'='sValue;
    378394            return sValue;
    379395        end
     
    395411 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    396412 */
    397 ReadDescription: procedure;
     413ReadDescription: procedure expose (sGlobals);
    398414    parse arg sDefFile, sDefFile2
    399415
     
    449465        call stream sDefFile, 'c', 'close';
    450466        sValue = substr(sLine, 2, iEnd - 2);
    451         say 'Found Description:' sValue;
     467        if (iVerbose >= 2) then
     468            say 'Found Description:' sValue;
    452469        return sValue;
    453470    end
     
    470487 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    471488 */
    472 UpdateDefFile: procedure;
     489UpdateDefFile: procedure expose (sGlobals);
    473490    parse arg sDefFileIn, sDefFileOut, sDescription
    474491
     
    566583    return 0;
    567584
     585
     586/**
     587 * Get environment variable value.
     588 * @returns Environment variable value if set.
     589 *          '' if not set.
     590 * @param   sVar    Variable name.
     591 */
     592getenv: procedure
     593parse arg sVar
     594return value(sVar,,'OS2ENVIRONMENT');
     595
     596
     597/**
     598 * No value handler
     599 */
     600NoValueHandler:
     601    say 'NoValueHandler: line 'SIGL;
     602return 0;
     603
Note: See TracChangeset for help on using the changeset viewer.