Changeset 1602


Ignore:
Timestamp:
05/26/12 17:05:42 (12 months ago)
Author:
bruno
Message:
  • pb_system will echo systematically the word ERROR when one occurs, even if non blocking to ease search in logs.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb-modules/lib/ProjectBuilder/Base.pm

    r1597 r1602  
    163163# Exit now if the command may fail 
    164164if ((defined $verbose) and ($verbose eq "mayfail")) { 
    165     pb_log(0,"N/A\n") if ($res != 0); 
     165    pb_log(0,"non blocking ERROR $res ($!)\n") if ($res != 0); 
    166166    pb_log(0,"OK\n") if ($res == 0); 
    167167    return($res)  
     
    170170my $cwd = getcwd; 
    171171my $error = undef; 
    172 $error = "failed to execute ($cmd) in $cwd: $!\n" if ($res == -1); 
    173 $error = "child ($cmd) died with signal ".($res & 127).", ".($res & 128) ? 'with' : 'without'." coredump\n" if ($res & 127); 
    174 $error = "child ($cmd) cwd=$cwd exited with value ".($res >> 8)."\n" if ($res != 0); 
     172$error = "ERROR: failed to execute ($cmd) in $cwd: $!\n" if ($res == -1); 
     173$error = "ERROR: child ($cmd) died with signal ".($res & 127).", ".($res & 128) ? 'with' : 'without'." coredump\n" if ($res & 127); 
     174$error = "ERROR: child ($cmd) cwd=$cwd exited with value ".($res >> 8)."\n" if ($res != 0); 
    175175 
    176176if (defined $error) { 
     
    178178    pb_display_file("$ENV{'PBTMP'}/system.$$.log") if ((-f "$ENV{'PBTMP'}/system.$$.log") and ((! defined $verbose) || ($verbose ne "quiet") || $Global::pb_stop_on_error)); 
    179179    if ($Global::pb_stop_on_error) { 
    180         confess "error running command ($cmd) with cwd=$cwd, pid=$$"; 
    181     } 
     180        confess("ERROR running command ($cmd) with cwd=$cwd, pid=$$"); 
     181    } else { 
     182        pb_log(0,"ERROR running command ($cmd) with cwd=$cwd, pid=$$"); 
    182183} else { 
    183184    pb_log(0,"OK\n") if ((! defined $verbose) || ($verbose ne "quiet")); 
Note: See TracChangeset for help on using the changeset viewer.