Changeset 756

Show
Ignore:
Timestamp:
08/12/07 03:08:31 (1 year ago)
Author:
Gregor
Message:

sss/conf.d: Added 'error' and 'warn' hook commands (see ticket #103).

docs/README.software_engineers: Updated to match.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docs/ChangeLog

    r755 r756  
    11SVN from 0.70: 
    22        - Fixed 'set' and 'add' commands (see ticket #102). 
     3        - Added 'error' and 'warn' hook commands (see ticket #103). 
    34 
    450.70 from 0.69: 
  • trunk/docs/README.software_engineers

    r754 r756  
    245245There are also a number of special, builtin commands available. 
    246246 
     247= warn and error = 
     248 
     249A warning or error condition can be specified by the hook commands 'warn' and 
     250'error'. 
     251 
     252An example of 'error': 
     253version (!Posix) { 
     254    prebuild=error Only POSIX is supported. 
     255} 
     256 
     257An example of 'warn': 
     258version (Posix) { 
     259    prebuild=warn POSIX support is untested. 
     260} 
     261 
     262When an error hook command is run, building of course halts. 
     263 
    247264= install = 
    248265 
     
    345362These are included at the top of the dsss.conf file. Common settings are 'name' 
    346363(the name of the software package) and 'version'. 
     364 
     365There is also a global setting available to specify which sections should be 
     366built normally, 'defaulttargets'. Without it, all sections will be built by 
     367default. The section list is simply separated by spaces: 
     368defaulttargets=xlib xbin 
    347369 
    348370It is also possible to specify global settings later in the dsss.conf file by 
  • trunk/sss/conf.d

    r755 r756  
    625625                 
    626626        } else if (tokens.length == 3 && 
    627                    tokens[1] == ":") { 
    628             // a command 
    629             if (tokens[0] == "warn") { 
    630                 // a warning 
    631                 writefln("WARNING: %s", tokens[2]); 
    632             } else if (tokens[0] == "error") { 
    633                 // an error 
    634                 writefln("ERROR: %s", tokens[2]); 
    635             } 
    636              
    637         } else if (tokens.length == 3 && 
    638627                   tokens[1] == "=") { 
    639628            // a setting 
     
    863852            // if it's a .d file, -exec it 
    864853            saySystemDie(dsss_build ~ "-full -exec " ~ cmd); 
     854 
     855        } else if (cmd.length > 5 && 
     856                   cmd[0..5] == "warn ") { 
     857            writefln("WARNING: %s", cmd[5..$]); 
     858 
     859        } else if (cmd.length > 6 && 
     860                   cmd[0..6] == "error ") { 
     861            writefln("ERROR: %s", cmd[6..$]); 
     862            exit(1); 
    865863             
    866864        } else if (cmd.length > 8 &&