Changeset 1651 in ProjectBuilder for devel/pb-modules/lib/ProjectBuilder/Base.pm


Ignore:
Timestamp:
Oct 7, 2012, 6:07:09 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Avoid to emit msgs when sed -i doesn't work (as on RedHat 6.2)
  • Factorize the proxy usages in pb_apply_conf_proxy and make it public (was partly done only)
  • debug level is now passed to the vescrip improving debug capabilities in that script
  • /dev/null shouldn't be touched on RedHat 6.2 as recreating it doesn't seem to work
  • Allow usage of mayfailverbose in pb_system when both features are needed to help debuging
  • Imrpove again RedHat 6.2 support up to setupve now (however needs a manual install of perl 5.6.2 to work as the minimum version for pb)
File:
1 edited

Legend:

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

    r1647 r1651  
    135135The first parameter is the shell command to call. This command should NOT use redirections.
    136136The second parameter is the message to print on screen. If none is given, then the command is printed.
    137 The third parameter prints the result of the command after correct execution if value is "verbose". If value is "noredir", it avoids redirecting outputs (e.g. for vi). If value is "quiet", doesn't print anything at all. If value is "mayfail", failure of the command is ok even if $Global::pb_stop_on_error is set, because the caller will be handling the error.
     137The third parameter prints the result of the command after correct execution if value is "verbose". If value is "noredir", it avoids redirecting outputs (e.g. for vi). If value is "quiet", doesn't print anything at all. If value is "mayfail", failure of the command is ok even if $Global::pb_stop_on_error is set, because the caller will be handling the error. A "verbose" can be added to mayfail to have it explain why it failed
    138138This function returns as a result the return value of the system command.
    139139
     
    160160my $res = $?;
    161161# Exit now if the command may fail
    162 if ((defined $verbose) and ($verbose eq "mayfail")) {
     162if ((defined $verbose) and ($verbose =~ /mayfail/)) {
    163163    pb_log(0,"NOT OK but non blocking\n") if ($res != 0);
    164164    pb_log(0,"OK\n") if ($res == 0);
     165    pb_display_file("$ENV{'PBTMP'}/system.$$.log") if ((-f "$ENV{'PBTMP'}/system.$$.log") and (defined $verbose) and ($verbose =~ /verbose/));
    165166    return($res)
    166167}
     
    178179        confess("ERROR running command ($cmd) with cwd=$cwd, pid=$$");
    179180    } else {
    180         pb_log(0,"ERROR running command ($cmd) with cwd=$cwd, pid=$$");
     181        pb_log(0,"ERROR running command ($cmd) with cwd=$cwd, pid=$$\n");
    181182    }
    182183} else {
Note: See TracChangeset for help on using the changeset viewer.