Hi,

As you may know there is a feature among my (partly pending) cmake-1.1 
PortGroup that allows port developers to obtain a local copy of the cmake 
invocation in the port's work directory. I'm trying to save cmake's output too 
because the copy in the port logfile has the habit of being gone just when you 
need it. (Even the regular upgrade process overwrites the logfile during the 
actual install/upgrade step.)

The most straightforward approach is this:

{{{
proc cmake.save_configure_cmd {{save_log_too ""}} {
    if {${save_log_too} ne ""} {
        pre-configure {
            configure.post_args-append "| tee 
${workpath}/.macports.${subport}.configure.log"
            ui_debug "cmake.save_configure_cmd set configure.post_args to 
\"${configure.post_args}\""
        }
    }
    post-configure {
        if {![catch {set fd [open 
"${workpath}/.macports.${subport}.configure.cmd" "w"]} err]} {
# etc
}}}

That works but has a side-effect when cmake fails and returns an error that 
surprised me (being a *csh user).
I deduce that sh (and thus the regular system()(2) call?) return the exit code 
of the last command to the caller, in this case `tee`, instead of some logical 
combination of all exit codes of processes on the pipeline.

Is there a clever trick around this?

Thanks,
René

Reply via email to